With the release of the latest version of Visual Studio, Microsoft has introduced a new Razor Editor for local development using MVC, Razor Pages, and Blazor. The tool is still experimental. Razor is an HTML-based and C-based template language that can be used to create dynamic content for .NET Web applications. It is not a programming language, but a server-side markup language.
In order to enable editor support for all these languages at the same time in the Razor file, Visual Studio needs to do some tedious work: parse the Razor document to determine its components, and then project each part into a language-specific buffer, the projection buffer. When you edit a Razor document, Visual Studio sees a collection of small windows to each projection buffer to form a complete document. Each language service then handles the editing experience for each buffer separately.
However, this scenario has a limited effect and does not apply to remote editing. To provide broader support for Razor editors, Microsoft has introduced a new Razor editor. It implements editor functions through the Language Server Protocol (LSP), such as auto-completion, go to definition, and so on. The IDE-specific Razor extension will then coordinate with the Razor language server and other language servers used for HTML.C.
To enable the new experimental Razor editor, you should first install the latest version of Visual Studio preview, go to the Tool sgt; options, and preview the feature, and then select the Enable Experimental Razor Editor option: