Microsoft has unveiled a new Razor editor for Visual Studio.

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.

Currently, Visual Studio can support intelliSense, completion, and diagnostics for HTML, CSS, JavaScript, C? and Razor-specific syntax in the same Razor file.

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.

Microsoft has unveiled a new Razor editor for Visual Studio.

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.

Microsoft has unveiled a new Razor editor for Visual Studio.

Microsoft says its current development focus is to make the new LSP-based Razor editor functionally identical to the existing Visual Studio Razor editing experience. Next, you plan to add support for JavaScript and CSS IntelliSense, URL selector support in HTML, complex C- completion, definition/implementation from C? to Razor, and more.

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:

Microsoft has unveiled a new Razor editor for Visual Studio.