Visual Studio 2022 Extension
I'm working on a visual studio 2022 Extension. But as soon as i import it inside the visual studio 2022 "Tools" -> "Code Snippet Manager" it will work in files like: HomeController.cs but not in home.cshtml (All .cshtml files). What kind of <Code Language="" do i need to put in here to get it working in .cshtml files. I have tried 'html' & "razor" but that didn't work.
8 Replies
Code snippets schema reference - Visual Studio (Windows)
Learn about the IntelliSense Code Snippet XML schema and how you can use them to increase your own productivity.
you can also use the latest schema
@David Wengier (π¦πΊπ¦π¨) does the lsp editor even support code snippets?
No, but in 17.8 we'll find html snippets and show them in completion ourselves, so I would have expected that to work.
@Andrew (ryzngard | they/them) is the expert here though
Correct, only inbox c# snippets are available prior to 17.9 P1. 17.9 P1 will add all HTML snippets. In LSP snippets show in the completion list so enter or tab will insert them
There is a backlog item for VS to support snippets similar to how VS Code does, in which case we'll be out of the equation entirely. If you try 17.9 P1 and still hit issues feel free to reach out or file an issue at https://github.com/dotnet/razor/issues
GitHub
Issues Β· dotnet/razor
Compiler and tooling experience for Razor ASP.NET Core apps in Visual Studio, Visual Studio for Mac, and VS Code. - Issues Β· dotnet/razor
oh, is it 17.9 P1? oops, thought it was 17.8. my b
17.8 seemed to drag on forever imo π¦ I think it went in around 17.8 P4