Skip to content

Shouldn't c++ preprocessor #elif's textmate scope be keyword.control.directive.conditional.elif? #532

Description

@alexr00

From @REYNEP in microsoft/vscode#114297

Checklist

  • This problem exists even with the setting "C_Cpp.enhancedColorization": "Disabled"
  • This bug exists for C
  • This bug exists for C++
  • This bug exists for Objective-C
  • This bug exists for Objective-C++

The code with a problem is:

#elif

It looks like:

#if

It should look like:

WHY?:-

  1. all conditional Preprocessor Commands, #if, #else, #endif, #ifdef, #ifndef are inside keyword.control.directive.conditional (eg. keyword.control.directive.conditional.ifdef)
  2. But #elif is inside keyword.control.directive, (like this: keyword.control.directive.elif)
  3. Shouldn't #elif's textmate scope be under keyword.control.directive.conditional too like the others?

I have fixed this by modifying cpp.tmLanguage.json
At Line 12683 if you add elif beside the other #if #ifdef #ifndef preprocessor commands, this gets fixed

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions