From 2b08994fa29a95fea2cc940a52b51e0202715e13 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Tue, 24 Mar 2020 15:26:06 -0700 Subject: [PATCH] Associated our TextMate grammar scopes with VS classifications. - 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: https://github.com/dotnet/aspnetcore/issues/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 --- .../aspnetcorerazor.tmLanguage.tmTheme | 252 ++++++++++++++++++ 1 file changed, 252 insertions(+) create mode 100644 src/Razor/src/Microsoft.VisualStudio.RazorExtension/EmbeddedGrammars/aspnetcorerazor.tmLanguage.tmTheme diff --git a/src/Razor/src/Microsoft.VisualStudio.RazorExtension/EmbeddedGrammars/aspnetcorerazor.tmLanguage.tmTheme b/src/Razor/src/Microsoft.VisualStudio.RazorExtension/EmbeddedGrammars/aspnetcorerazor.tmLanguage.tmTheme new file mode 100644 index 0000000000..7f15ea1433 --- /dev/null +++ b/src/Razor/src/Microsoft.VisualStudio.RazorExtension/EmbeddedGrammars/aspnetcorerazor.tmLanguage.tmTheme @@ -0,0 +1,252 @@ + + + + + name + Razor TextMate Theme + settings + + + + + + scope + string - meta.attribute, punctuation.definition.string - meta.attribute, punctuation.definition.template-expression, constant.character.escape, constant.regexp, markup.heading, string.quoted.double.cs + settings + + vsclassificationtype + string + + + + + scope + comment + settings + + vsclassificationtype + Comment + + + + + + + + + scope + keyword.control.cshtml, keyword.control.razor.directive, keyword.control.razor.comment.star + settings + + vsclassificationtype + HTML Server-Side Script + + + + + + + + + + scope + punctuation.definition.tag, punctuation.separator.key-value.html + settings + + vsclassificationtype + HTML Operator + + + + + + scope + entity.name.tag + settings + + vsclassificationtype + HTML Element Name + + + + + + scope + entity.other.attribute-name + settings + + vsclassificationtype + HTML Attribute Name + + + + + + scope + meta.attribute, meta.attribute string.quoted + settings + + vsclassificationtype + HTML Attribute Value + + + + + scope + comment.block.html + settings + + vsclassificationtype + HTML Comment + + + + + + + + + scope + variable + settings + + vsclassificationtype + Identifier + + + + + scope + constant.language, variable.language, storage.modifier.cs, keyword.type.cs, keyword.other.using.cs, keyword.other.await.cs, keyword.other.var.cs + settings + + vsclassificationtype + Keyword + + + + + scope + storage.type.cs, entity.name.type.class.cs + settings + + vsclassificationtype + class name + + + + + scope + entity.name.function.cs + settings + + vsclassificationtype + method name + + + + + scope + variable.other.object.cs, entity.name.variable.local.cs + settings + + vsclassificationtype + local name + + + + + scope + keyword.control.conditional, keyword.control.loop.in.cs, keyword.control.loop.foreach.cs + settings + + vsclassificationtype + keyword - control + + + + + scope + entity.name.label + settings + + vsclassificationtype + parameter name + + + + + + + + + scope + entity.name.tag.css + settings + + vsclassificationtype + CSS Selector + + + + + scope + support.type.property-name.css + settings + + vsclassificationtype + CSS Property Name + + + + + scope + support.constant.color.w3c-standard-color-name.css + settings + + vsclassificationtype + CSS Property Value + + + + + scope + comment.block.css + settings + + vsclassificationtype + CSS Comment + + + + + + + + + scope + source.js storage.type, source.js keyword.operator.new + settings + + vsclassificationtype + keyword + + + + + scope + source.js string + settings + + vsclassificationtype + string + + + + + + + uuid + D5935FC5-F04D-4021-83FD-66BCA3F452D2 + +