vscode-csharp icon indicating copy to clipboard operation
vscode-csharp copied to clipboard

Use OmniSharp Razor grammar as default in VS Code

Open alexr00 opened this issue 3 years ago • 5 comments

Hello 👋

I work on VS Code and maintain our syntax highlighting grammars there. We pull almost all of our grammars from other OSS repos. The grammar we've been using for Razor is no longer maintained. It looks like you have a maintained grammar: https://github.com/OmniSharp/omnisharp-vscode/blob/master/src/razor/syntaxes/aspnetcorerazor.tmLanguage.json

I'd like to switch over to use the OmniSharp Razor grammar as the default, built-in, Razor grammar in VS Code. I've switched over to use this grammar for the next VS Code Insiders build: https://github.com/microsoft/vscode/pull/163212. If you have any concerns about this please let me know! It should be a much better experience for Razor users in VS Code.

alexr00 avatar Oct 10 '22 19:10 alexr00

Its with that grammar syntax that I took the screenshots? Specifically that one that doesn't work

ArmantG avatar Oct 11 '22 14:10 ArmantG

@ArmantG this grammar should still be an improvement over the old one even though it still doesn't work for the example you gave (quick testing showed it did better on the snipped we use for testing). And, once we've moved over to a grammar that's actually being maintained we can file issues that may be addressed.

alexr00 avatar Oct 11 '22 14:10 alexr00

@davidwengier Should this Razor grammar be moved in box?

JoeRobich avatar Oct 12 '22 21:10 JoeRobich

We have a Razor grammer over here, which I would assume is the one we would keep updated going forward: https://github.com/dotnet/razor-tooling/blob/main/src/Razor/src/Microsoft.AspNetCore.Razor.VSCode.Extension/syntaxes/aspnetcorerazor.tmLanguage.json

Though @allisonchou knows more about this than me I expect :)

davidwengier avatar Oct 12 '22 22:10 davidwengier

I agree with David - if possible, I think it would be best if VS Code pulled the grammar in the razor-tooling repo since it's kept the most up-to-date.

allisonchou avatar Oct 13 '22 19:10 allisonchou

Great, thank you for the pointer. I've updated VS Code pull from https://github.com/dotnet/razor-tooling.

alexr00 avatar Oct 17 '22 23:10 alexr00

Looks like this got done: https://github.com/microsoft/vscode/pull/163898

@JoeRobich can you close this :)

davidwengier avatar Oct 24 '22 03:10 davidwengier