-
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
Add .cpp at the end of the Textmate Colorization scopes. #7773
Comments
Are you referring to semantic token scopes (https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide) or lexical/syntax scopes (https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide)? Our extension doesn't provide any lexical scopes (they're obtained by VS Code from https://github.com/jeff-hykin/cpp-textmate-grammar/issues), and semantic tokens we provide are mapped to fallback textmate scopes by VS Code (https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide#predefined-textmate-scope-mappings). |
@REYNEP When VS Code looks up a TextMate scope, it uses a fully qualified scope (including ".cpp" if the file is C++). I don't believe it's necessary for the C++ extension to specify this anywhere. There is a fallback approach that is used to match a scope in a Theme. It will try the fully qualified scope first, then reduce it until a match is found. For example: That said, is there a specific scenario in which this lookup is not working as expected for you? Where exactly are you suggesting ".cpp" needs to be added? Are you seeing an issue related to the TextMate fallback scopes used by our semantic token provider? Our semantic token provider supports both C and C++ sources, so cannot specify ".c" or ".cpp" in the fallback Textmate scopes for semantic tokens in |
@Colengms & Sean-mcmanus, I apologize for late reply.... I think even if One such case is:- Also couldn't C/C++ Extension get the fileName and then if |
@Colengms The relevant doc appears to be https://code.visualstudio.com/api/language-extensions/semantic-highlight-guide#custom-textmate-scope-mappings. Should we add stuff like
or is that the responsibility of the TextMate grammar provider (https://github.com/jeff-hykin/cpp-textmate-grammar/)? |
@REYNEP Some semantic fallback scopes are provided by VS Code itself, such as I do see that the following section was recently added to the document here.
However, our extension is not a TextMate grammar provider... As an experiment, could you try replacing the JSON (Click to expand)
If that content addresses the issue, we could potentially release it as a work-around. However, I believe the root issue here is a VS Code issue, and it should be responsible for appending language-IDs when looking up semantic token fallback scopes. |
Oh, @Colengms, I am really sorry for Late reply, But, The changed Thanks for making it work, sir. |
Hi @REYNEP . I opened the following issue against VS Code: microsoft/vscode#128565 Were you only seeing issues with semantic token fallback scopes, or were you seeing a similar issue in other scenarios? |
Only the ones that C/C++ extensions used. I guess those are fallback scopes |
This should be addressed in 1.6.0-insiders. |
Type: Feature Request
Currently none of the textmate Scopes [a.k.a Semantic token] have .cpp in them. Without that, no Theme can target Specific Language. And After using a lot of themes, it feels like, Most of the Theme Authors does that. Vanilla VSCode textMate scopes does have
.cpp
like language specifications at the end. And that helps a lot.... 🙂The text was updated successfully, but these errors were encountered: