Sublime Text syntax highlighting for .cshtml, .aspx, and similar files.
- Embedded C# (
<script runat="server">)- The
runat="server"must immediately follow the tag opening.
- The
<%expressions (including<%=,<%#,<%:,<%$,<%--)
-
Hotkey comment/uncomment server-side comments (Ctrl+/ or Cmd+/)
-
Snippets for
<%-ish expressions -
Snippets for some directives (Try
pageorimport)- Default attributes are subject to change.
-
Snippets may require Ctrl+space, depending on your environment.
-
Some autocomplete within directives.
A huge thank-you to @keith-hall for this!
- Identify more attributes of directives
- Autocomplete ASP builtins
-
"Goto Anything" support is poor.
-
No recognition of excluded scopes to return to HTML. In the snippet below, the C# scope ends immediately after
"bar.<% var foo = "bar%>"; %> -
Javascript does not always recognize that
Response.Writeoutput is coming. The)is marked as invalid and the conditional scopes are never terminated.<script type="text/javascript"> if (true && <%= list.Any() %>) { doStuff(); } </script>