Razor is the syntax used in ASP.NET development now, most of this uses ASP.NET MVC which uses Razor instead of webforms syntax, which ASP syntax kind of serves well.
To support Razor we can start with ASP syntax with the following differences:
Highlight the @ symbol. This is used to inject code (C#) in Razor. We don't need to highlight the code (will be tough I guess), but just highlight the @ symbol itself
Use the following syntax as comment: @* for opening, and *@ for closing
These are the most important I guess.
Nice to have but can be ignored:
Treat @@ as normal text (that's escaped @)
Offer C# syntax inside the block @{ /* C# code here, multiline */ } as it's used to write code, like the <% /*code*/ %> in ASP
Offer C# syntax inside @( somethingAsCSharp ) as it's one way to make sure C# code doesn't conflict with rest of HTML (equivalent to <%= something %> in ASP)
This would be very useful. Basic C# syntax highlighting is also currently broken and has been for a long time, see the issue I raised here. It seems to get the keywords right but types are usually the wrong colour.
A basic support for Razor will be really great.
Razor is the syntax used in ASP.NET development now, most of this uses ASP.NET MVC which uses Razor instead of webforms syntax, which ASP syntax kind of serves well.
To support Razor we can start with ASP syntax with the following differences:
@
symbol. This is used to inject code (C#) in Razor. We don't need to highlight the code (will be tough I guess), but just highlight the@
symbol itself@*
for opening, and*@
for closingThese are the most important I guess.
Nice to have but can be ignored:
@@
as normal text (that's escaped@
)@{ /* C# code here, multiline */ }
as it's used to write code, like the<% /*code*/ %>
in ASP@( somethingAsCSharp )
as it's one way to make sure C# code doesn't conflict with rest of HTML (equivalent to<%= something %>
in ASP)