-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Incorrect highlighting with C/C++ when macro call does not end in semicolon #3934
Comments
Hi @tristan957 . Thanks for reporting this. Could you provide an isolated repro? I've tried cloning your repo ( https://github.com/tristan957/harvest-almanac.git ), but there are some headers that aren't resolving. If you could provide a complete, isolated example (preferably minimal), that would save us a lot of guesswork. |
I will get to that when I get home. Can unresolved include errors throw off syntax parsing? |
The semantic colorization feature we recently added (C_Cpp.enhancedColorization) leverages IntelliSense to provide colors for tokens. So, what IntelliSense has parsed previously could be relevant to how it interprets subsequent code. Currently, with some headers not resolving, I see code after that macro colored correctly with and without the semicolon, but I also see a few squiggles before and after due to missing declarations/headers, so the code is likely not being interpreted for me in the same way it is for you. |
Then I think this issue can be closed. I guess the semantic colorization can't determine whether the macro is actually a macro or a function without analyzing the header file that it comes from. I do not see this discolor if I am on my machine with includePaths set. I am going to close the issue because I do not see a way around this. @Colengms feel free to reopen it if you feel there is something that can be done. If so, I will provide a small sample. |
Type: General
I have produced a valid C file in which syntax colorization is thrown off if a macro invocation does not end in a semicolon.
Describe the bug
To Reproduce
Use the following file
Expected behavior
Proper syntax highlighting.
Screenshots
Please refer to this issue jeff-hykin/better-cpp-syntax#311.
Additional context
I had previously opened an issue with the Better C++ Syntax repo, but realized this extension was the culprit. You will notice this issue also affects GitHub's syntax highlighting. I have also opened an issue with their upstream.
The text was updated successfully, but these errors were encountered: