-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
C11 keywords support #6022
Comments
Hi @SPAstef . The C/C++ Extension provides semantic colorization. However, these are not semantically detected identifiers (unless implemented as macros), these are language keywords. Colorization for language keywords comes from VS Code and it's TextMate language grammar. That grammar for C/C++ is contributed by this repro: https://github.com/jeff-hykin/cpp-textmate-grammar That grammar is also available in the "Better C++ Syntax" extension, and is often updated more frequently than updates are contributed to VS Code. I'd suggest opening issues for any uncolored keywords in that repo. If I understand correctly, language keywords are also added by VS Code, not the extension. |
I think proper handling of C keywords is being tracked by jeff-hykin/better-cpp-syntax#70 . |
Hi, and thanks for the reply! |
Ok I'll give it a look, thanks |
"_Alignof" was intentionally omitted from our keyword completion, because the recommended style is to use |
I read the issue you linked. Mixing C and C++ IMHO is never a good thing, especially considering the completely different pace at which C++ moves and the orders of magnitude of complexity in its grammar. It's almost like mixing Java and JavaScript grammars since they have a similar name... |
We fixed the issue with "alignas" etc. appearing as keywords in C with https://github.com/microsoft/vscode-cpptools/releases/tag/0.30.0-insiders4 . "_Alignof" etc. aren't added because using the macros defined in stdalign.h etc. is recommended instead (those macros will appear in completion after the headers are added). |
Closing this, as we don't generally track issues with VS Code's TextMate grammar in this repo. If there is a detail here that I missed that can be addressed by the C/C++ Extension, please let me know. :) |
In the current version of the extension, support for C11 keywords such as _Alignas, _Alignof, _Generic, etc. is quite weird:
The screenshot below shows all the problems I've encountered.
Settings that might take part in this:
"C_Cpp.default.cStandard" = "c18"
"C_Cpp.default.intelliSenseMode": "clang-x64" (but it is the same with gcc-x64)
The text was updated successfully, but these errors were encountered: