Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

F1 help for #if and #else refers to preprocessor symbols, not if_CSharpKeyword and else_CSharpkeyword #69192

Merged
merged 5 commits into from
Aug 1, 2023

Commits on Jul 24, 2023

  1. Add failing test

    The F1 service should produce `#if` instead of `if_CSharpKeyword` when
    the cursor is on the `#if` symbol.
    
    Add other tasks for the other preprocessor symbols related to
    conditional compilation. The `#if` and `#else` fail, because the model
    finds child nodes for `if` and `else`, respectively. The tests for
    `#elif` and `#endif` pass, because the model does not find child nodes
    for those tokens.
    BillWagner committed Jul 24, 2023
    Configuration menu
    Copy the full SHA
    f308583 View commit details
    Browse the repository at this point in the history

Commits on Jul 28, 2023

  1. Test for preprocessor before keyword

    Because the `#if` and `#else` preprocessor tokens contain the text for keywords (`if` and `else`), the `TryGetTextForKeyword` would lock to those keywords before the `TryGetTextForPreProcessor` looked for the preprocessor token. By switching the order of those two tests, the longer preprocessor tokens are found first.
    BillWagner committed Jul 28, 2023
    Configuration menu
    Copy the full SHA
    ff087ee View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2023

  1. Check parent of nodes

    The "if" and "else" nodes may appear as "if" / "else" or "#if" / "#else".
    
    If the parent isn't the if statement or else clause, don't treat them as keywords. Then, the later processing will find them as preprocessor tokens and correctly route the request.
    BillWagner committed Jul 31, 2023
    Configuration menu
    Copy the full SHA
    d617b2f View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2023

  1. Configuration menu
    Copy the full SHA
    69248d6 View commit details
    Browse the repository at this point in the history
  2. Simplify

    CyrusNajmabadi committed Aug 1, 2023
    Configuration menu
    Copy the full SHA
    ccdc31f View commit details
    Browse the repository at this point in the history