Add scopes for cpptools colorization, to light_vs and dark_vs #75916
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We've added colorization to cpptools, using TextEditorDecorations. We are leveraging the existing system for theming and customization. A list of scopes we are using to retrieve color settings are here: /~https://github.com/microsoft/vscode-cpptools/blob/master/Documentation/LanguageServer/colorization.md
This PR is to add those scopes to the default VS Light and Dark themes. The scopes are specifically for C and CPP, so should not affect other languages. Scopes for the default TextMate grammar for C/CPP are limited, so very few of these will be applied if the cpptools extension is not present and enhancedColorization enabled.
I would be very interested in feedback regarding the scope names we have chosen. As there are not strict guidelines for scope naming, these are a best effort to use appropriate names. But, I would be interested in hearing from someone with more experience with TextMate scopes on whether these are the most appropriate names.
A list of all of the known issues we have encountered with attempting to do colorization this way, are here:
• VSCode: TextEditorDecoration applied to incorrect range if racing with user edit
#74094
• VSCode: TextEditorDecorators should also be rendered in minimap
#73140
• VSCode: Text selection highlight is not shown on decorations w/background colors
#75642
• VSCode: Option to not style rendered whitespace with TextEditorDecorationType
#49462
Related issues:
• VSCode: Provide an API for advanced/semantic source highlighting
#585
• VSCode: Dynamic injection grammar contributions
#53885
We are overwriting the package.json instead, which requires a reload.
• VSCode: [theming] Access theme's colors programmatically
#32813
We are loading theme files, scanning token color and textMateRule override settings, and compositing cascaded styles, ourselves.
• Language-server-protocol: Support semantic highlighting
microsoft/language-server-protocol#18