Did you know you can inject languages into string literals with a comment in #JetBrainsRider? It will enable basic syntax highlighting and *some* code completion in the string literal. Additionally it will give you warnings if the string literal is not valid in the chosen language.

In .NET 7 you will also be able to use the StringSyntaxAttribute https://learn.microsoft.com/dotnet/api/system.diagnostics.codeanalysis.stringsyntaxattribute which also works in #VisualStudio. But attributes can't be used everywhere (e.g. for local variables).

#dotnet @dotnet

StringSyntaxAttribute Class (System.Diagnostics.CodeAnalysis)

Specifies the syntax used in a string.

@bitbonk Yet another feature that makes #JetBrainsRider the undoubted king of #dotnet IDE’s! Thanks for sharing!
@zacpwhite To be fair, the attribute currently *only* works in VS. But I guess it will be supported in Rider, once 2022.3 hits the streets. @khalidabuhakmeh @maartenballiauw might know more.