Visual Studio 2022 introduces the new Razor editor.
Visual Studio 2022 introduces the new Razor editor. You can now utilise the new Razor editor for local ASP.NET Core development with MVC, Razor Pages, and Blazor with the release of Visual Studio 2022.
what is VISUAL STUDIO ?
Visual Studio is a Microsoft Integrated Development Environment (IDE) used to create GUI (Graphical User Interface), console, Web applications, online apps, mobile apps, cloud, and web services, among other things. With the aid of this IDE, you may generate both managed and native code. It makes use of Microsoft software development platforms such as Windows Store, Microsoft Silverlight, and Windows API, among others. It is not a language-specific IDE because it can be used to develop code in C#, C++, VB (Visual Basic), Python, JavaScript, and many more languages. It supports a total of 36 distinct programming languages. It is accessible for both Windows and macOS.
download the updated virtual studio 2022 version
The Advantages of Using a Razor Language Server Protocol :
We've been working on a new Razor editor for ASP.NET Core applications based on a Language Server Protocol for quite some time (LSP). The Language Server Protocol (LSP) is an accessible technology that specifies a standard method for enabling functionality in an editor or IDE. The LSP approach has allowed us to rapidly add significant new capabilities, introducing many more C# editing tools to Razor and allowing other new Razor-specific productivity enhancements.
What's new with the new Razor editor?
The new model makes it easier to introduce new code fixes and code refactoring. The most often used refactoring, Add missing usings, is now implemented in the Razor editor, along with many others!
A few options of adding that are relevant to Razor development have also been included. These are essential for learning Razor's daily syntax and common components. If you prefer the code behind the pattern, for example, Extract block to code-behind allows you to extract an entire code block to a code-behind file.
Add usings for components, Fully qualify components, and Create components are some of the new Razor refactorings. Many more are on the way as Razor develops. There is also improved navigation. Go to Definition is one of the most frequently used navigation options in Visual Studio. Go to Definition on components allows you to easily move between files in order to better understand your code. Pressing F12 on a constituent tag, for example, will now take you directly to the component code.
When the F5 experience includes important diagnostics, a cutting-edge feature like Hot Reload is ideal. This assistance would not have been available without the new LSP model of the Razor editor. In the new Razor editor, the default colors have been modified. The elimination of the code backdrop illumination that was included in prior editions is a significant change in this area. This highlight made it difficult to discern between options and increased visual clutter for many programmers.
As additional code styles, refactoring, and completion features are developed on a regular basis, formatting is an active area. The new editor has enhanced formatting that can keep up with these changes, allowing code to remain visually consistent. The new Razor editor supports the most recent compiler capabilities while also improving current syntactic interactions. Razor syntax completions that are smarter, such as completion and auto-complete, are now supported. The new editor additionally alters the flow of diagnostics to guarantee that only the most significant diagnostics are displayed and that diagnostics generated by the compiler are displayed in their intended fidelity.
Razor now supports Visual Studio Live Share in its entirety. A live Share is a great tool for remote collaboration with other developers that allows code-sharing from within the IDE. For many engineers, the shared context is a vital aspect of the everyday cycle of co-programming.
Since its inception over a decade ago, Razor has amassed a substantial backlog of feature requests and issues. It was difficult and costly to address these flaws with the traditional Razor editor. The new Razor editor positions the team for success by allowing them to provide bug fixes and functionality more quickly. We've been following the feedback on the new editor (many thanks to everyone!) and realize we have a long way to go. Our priority has been to bring the new Razor editor up to functional parity with the previous Razor editor, as well as to improve quality and performance. There are still a few functional holes to fill, which we anticipate will be addressed in future versions. The following are some of the recognized restrictions that we are striving to address:
Snippets assistance (expansion with Tab)
Div Wrap Shortcut Shift+Alt+W
Ctrl+Click Go to Definition
#region code folding for more information.
JavaScript formatting embedded
HTML, CSS, and JavaScript files may be dragged and dropped.
Enhancements to performance and dependability
When debugging Blazor Web Assembly projects, Hot Reload functionality is provided.
On GitHub, you can find out more about our plans and when we expect to fix these concerns. If you feel that the new editor limits your development productivity, you may restore to the legacy editor by heading to Tools > Options > Text Editor > HTML > Advanced and selecting True from the selection next to Use traditional Razor editor for ASP.NET Core. Keep in mind that the traditional Razor editor will have restricted functionality and will not contain the productivity enhancements discussed in this post that we included in the new Razor editor.