-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Add Razor theme to properly colorize Razor constructs in Visual Studio. #18769
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
Comments
- The new grammar will apply to our LSP editor Razor files. - The grammar doesn't look to colorize the embedded languages correctly. Have reached out to the VS editor team to investigate the issue further. - Couldn't add tests because this was more of an end-to-end scenario. - Added a new pkdef to our extension to allow us to hand-edit pkdef's (ours are usually auto-generated) for features that do not have a code-first model (TextMate). - Expanded the VSIX extension to build the grammar project on run to ensure we always get the latest grammar. - Does not include "proper" colorization of Razor constructs, that's tracked at dotnet/aspnetcore#18769 dotnet/aspnetcore#17801
Investigated this a bit further to see what it would mean for VSCode and the result is that VSCode doesn't currently support theming background colors. This means we can't unify our VSCode colors with Visual Studio because the Razor transition characters have a yellow background with black text. I played around with making those control characters entirely yellow but it just looked wrong. The work in this issue will provide theming to solely VS and purposefully not include any changes to the VSCode world. |
@NTaylorMullen seems like you was trying to do the same as me, in getting a matching style of black on yellow as the big brother VS does - microsoft/vscode#90070 |
@warrenbuckley woa, totally didn't read the body of the issue. Ya totally same gist. |
- The new grammar will apply to our LSP editor Razor files. - The grammar doesn't look to colorize the embedded languages correctly. Have reached out to the VS editor team to investigate the issue further. - Couldn't add tests because this was more of an end-to-end scenario. - Added a new pkdef to our extension to allow us to hand-edit pkdef's (ours are usually auto-generated) for features that do not have a code-first model (TextMate). - Expanded the VSIX extension to build the grammar project on run to ensure we always get the latest grammar. - Does not include "proper" colorization of Razor constructs, that's tracked at dotnet/aspnetcore#18769 dotnet/aspnetcore#17801
Capturing some of @danroth27's epic colorization investigation so we can ensure we work applicable pieces into VS.
|
- This makes our new Razor LSP editor bits look almost identical to the existing VS experience. - There are several issues in regards to C# in attributes and that's tracked here: dotnet/aspnetcore#20140 - There's no semantic colorization for tags or C# yet either so that breaks down the colorization expected for our Blazor components and TagHelpers. - Had to name the textmate grammar with the specific name of `aspnetcorerazor.tmLanguage.tmTheme` in order to enable the VS themeing support to locate our theme. - One big colorization difference that can't currently be supported is the background coloring of our C# bits. This is something VS' CoreEditor is willing to change on our behalf though. Fixes dotnet/aspnetcore#18769
- This makes our new Razor LSP editor bits look almost identical to the existing VS experience. - There are several issues in regards to C# in attributes and that's tracked here: dotnet/aspnetcore#20140 - There's no semantic colorization for tags or C# yet either so that breaks down the colorization expected for our Blazor components and TagHelpers. - Had to name the textmate grammar with the specific name of `aspnetcorerazor.tmLanguage.tmTheme` in order to enable the VS themeing support to locate our theme. - One big colorization difference that can't currently be supported is the background coloring of our C# bits. This is something VS' CoreEditor is willing to change on our behalf though. Fixes dotnet/aspnetcore#18769
Today in Visual Studio we have Razor syntactic colorization but all Razor constructs are colored blue. We should tie this to the existence Razor
@
classification or fall back to our own in the case the Razor workload is not installed.Best practice is to
ClassificationFormatDefinition
in Core VS that's used to colorize Razor constructs in the absense of the Razor workload.ClassificationFormatDefinition
For this issue we'll probably create our own
ClassificationFormatDefinition
that doesn't go in Core VS yet (shipped as part of our extension) as a stepping stone to properly colorize just the Razor LSP editor scenarios.The text was updated successfully, but these errors were encountered: