|
1 | 1 | # [HTML (C#)][pkg] |
2 | 2 |
|
3 | | -[Sublime Text][st] [syntax highlighting][ss-docs] for `.cshtml`, `.aspx`, and similar files. |
| 3 | +This project contains |
| 4 | +[syntax highlighting][ss-docs] |
| 5 | +and completions |
| 6 | +in [Sublime Text][st] |
| 7 | +for *.cshtml*, *.aspx*, and similar files. |
| 8 | +It was originally created for .Net WebForms, |
| 9 | +but later expanded |
| 10 | +to support Razor syntax as well. |
4 | 11 |
|
5 | 12 | ## WebForms |
6 | 13 |
|
7 | | -The old ASP.Net style pages that necessitated creation of this package. Post-Visual Basic ASP, but pre-Razor. |
| 14 | +Microsoft's ASP.Net pages with C# |
| 15 | +were the first thing |
| 16 | +that this package supported. |
| 17 | +The syntaxes also work for .Net MVC. |
| 18 | +The ASP syntax |
| 19 | +that Sublime Text ships with |
| 20 | +only supports Visual Basic. |
8 | 21 |
|
9 | 22 | ### Current support |
10 | 23 |
|
11 | 24 | #### Highlighting |
12 | 25 |
|
13 | | -- Embedded C# (`<script runat="server">`) |
| 26 | +- Embedded C# script blocks (`<script runat="server">`) |
14 | 27 | + The `runat="server"` must immediately follow the tag opening. |
15 | | -- `<%` expressions (including `<%=`, `<%#`, `<%:`, `<%$`, `<%--`) |
| 28 | +- ASP.Net inline expressions |
| 29 | + + Server-side comments (`<%--`) |
| 30 | + + Directives (`<%@`) |
| 31 | + + Output (`<%=`, `<%#`, `<%:`, `<%#:`, `<%$`) |
| 32 | + + Embedded code blocks (`<%`) |
16 | 33 |
|
17 | 34 | #### Functionality |
18 | 35 |
|
19 | | -- Hotkey comment/uncomment server-side comments (<kbd>Ctrl</kbd>+<kbd>/</kbd> or <kbd>Cmd</kbd>+<kbd>/</kbd>) |
20 | | - |
| 36 | +- Hotkey comment/uncomment server-side comments |
| 37 | + (<kbd>Ctrl</kbd>+<kbd>/</kbd> or <kbd>Cmd</kbd>+<kbd>/</kbd>) |
21 | 38 | - Snippets for `<%`-ish expressions |
22 | 39 | - Snippets for some directives (Try `page` or `import`) |
23 | 40 | + Default attributes are subject to change. |
24 | | -- Snippets may require <kbd>Ctrl</kbd>+<kbd>space</kbd>, depending on your environment. |
| 41 | +- Snippets may require <kbd>Ctrl</kbd>+<kbd>Space</kbd>, |
| 42 | + depending on your environment. |
25 | 43 | - Some autocomplete within directives. |
26 | | -- Basic "Open `CodeBehind`" shortcut for frontend pages. |
| 44 | +- Basic "Open CodeBehind" shortcut for frontend pages. |
| 45 | +- Naive "Open Front End" shortcut for codebehind files. |
27 | 46 |
|
28 | | -### Future support (maybe) |
| 47 | +### To-Do (maybe) |
29 | 48 |
|
30 | 49 | - Identify more attributes of directives |
31 | | -- Autocomplete ASP builtins |
| 50 | +- Snippets and/or completions for ASP.Net builtins |
| 51 | +- Refactor C# Handler syntax (*.ashx*) |
32 | 52 |
|
33 | 53 | ### Known issues |
34 | 54 |
|
35 | 55 | - Nothing yet? 🤞 |
| 56 | +- File new issues [on GitHub][gh] |
36 | 57 |
|
37 | 58 |
|
38 | 59 | ## Razor |
39 | 60 |
|
40 | | -The simplified, less-intrusive frontend templating syntax that supplanted WebForms. |
| 61 | +Microsoft later released |
| 62 | +a simplified, less-intrusive frontend templating syntax |
| 63 | +that supplanted WebForms. |
41 | 64 |
|
42 | | -A huge thank-you to [@keith-hall][keith] for his work on this. |
| 65 | +A huge thank-you is owed |
| 66 | +to [@keith-hall][keith] |
| 67 | +for his work on this. |
43 | 68 |
|
44 | 69 | ### Current Support |
45 | 70 |
|
46 | 71 | #### Highlighting |
47 | 72 |
|
48 | | -The highlighting is not exhaustive, nor is it perfect. Expect some problems. |
| 73 | +- Support for many `@` expressions |
| 74 | +- See Known Issues below for exceptions |
49 | 75 |
|
50 | 76 | #### Functionality |
51 | 77 |
|
52 | | -- Hotkey comment/uncomment server-side comments (<kbd>Ctrl</kbd>+<kbd>/</kbd> or <kbd>Cmd</kbd>+<kbd>/</kbd>) |
| 78 | +- Hotkey comment/uncomment server-side comments |
| 79 | + (<kbd>Ctrl</kbd>+<kbd>/</kbd> or <kbd>Cmd</kbd>+<kbd>/</kbd>) |
| 80 | + |
| 81 | +### Known issues |
| 82 | + |
| 83 | +- Trouble with `@(` in HTML attributes |
| 84 | + if the expression contains `"` |
| 85 | +- Trouble with `@` expressions in HTML attributes |
| 86 | + if they are inside `@` block expressions |
| 87 | +- Trouble with `@` expressions in embedded languages |
| 88 | + (i.e. in JavaScript) |
| 89 | + if they are inside `@` block expressions |
| 90 | +- File new issues [on GitHub][gh] |
53 | 91 |
|
54 | 92 |
|
55 | 93 | [pkg]: https://packagecontrol.io/packages/HTML%20(C%23) |
56 | 94 | [st]: https://www.sublimetext.com/ |
57 | 95 | [ss-docs]: https://www.sublimetext.com/docs/syntax.html |
| 96 | +[gh]: https://github.com/michaelblyons/SublimeSyntax-HTML-CSharp |
58 | 97 | [keith]: https://github.com/keith-hall |
0 commit comments