this post was submitted on 13 Feb 2025
5 points (100.0% liked)

.NET

1549 readers
2 users here now

Getting started

Useful resources

IDEs and code editors

Tools

Rules

Related communities

Wikipedia pages

founded 2 years ago
MODERATORS
 

Extract to Component refactoring and the new Roslyn-based C# tokenizer are now available

This new tokenizer is not on by default until .NET 10 but is available in both Visual Studio (17.13) and Visual Studio Code for .NET 9.

To enable the C# tokenizer today, check the Use the C# tokenizer for Razor files in the IDE option under Tools > Options > Preview Features and add <Features>use-roslyn-tokenizer;$(Features)</Features> to a property group in your .csproj or directory.props file

This new lexer does currently come with some breaking changes, particularly around preprocessor directives

you are viewing a single comment's thread
view the rest of the comments
[–] Kissaki 1 points 1 week ago

So glad this is landing and stuff like interpolated and raw strings can be used in .razor files going forward.