-
Notifications
You must be signed in to change notification settings - Fork 30
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
#else and #endif have incorrect colorization when in the middle of a function declaration parameter list #485
Comments
Duplicate of #31, but this one is a bit clearer about the problem. @jeff-hykin I don't believe the following potential solution has been discussed before.
Image if the match-rules for those directives had an effect on the rest of the grammar as to make them disappear. The new source would be
any code that follows that would be parsed as if it is in a function definition. The ability for preprocessor ranges to jump contexts means at least one of the paths has to be discarded. Though there will still be issues similar to #299 with this solution enum items {
item1,
item2,
#if foo
item3,
#else
item3_v2, // this is not colored like an enum member
#endif
item4
}; I should be able to resume contributing sometime next week. |
I think its not a duplicate cause this case isn't broken on C++ only C. @matter123 Yeah I think that is a more clear version of strategy 2 from #31 |
To clarify:
Even if the previous point is fixed, (by duplicating the range for each context), The context of the ranges will actually be influenced by the contents of the |
Checklist
"C_Cpp.enhancedColorization": "Disabled"
The code with a problem is:
It looks like:
Dark+ Theme
It should look like:
Not red, like #if.
This could be a duplicate, but it was hard for me to tell.
The text was updated successfully, but these errors were encountered: