Skip to content

Commit 3a62e5f

Browse files
committed
Reorg for v4.0.0
- Add a scope suffix to ASP.Net/WebForms to differentiate from Razor. + *Breaking change:* The Razor syntax now "owns" the `.cshtml` file extension. If you need it bound to WebForms-style pages, use the "Open all with current extension as..." option from the Syntax selector menu in the bottom-right. + This also means that completions and so on can be more easily targeted at one or the other syntax. - Move some completions to snippets + *Breaking change:* The `exp*` completions have been removed in favor of typing the `<%*` expressions themselves. - Enable autocomplete by default in ASP.Net, and on `@` for Razor. - Razor gets comment block toggling (although it's not perfect).
1 parent c8bd54e commit 3a62e5f

25 files changed

Lines changed: 263 additions & 48 deletions

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2016-2019 Michael Lyons
1+
Copyright 2016-2020 Michael Lyons
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
44

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# [HTML (C#)][pkg]
22

3-
[Sublime Text 3][st3] [syntax highlighting][ss-docs] for `.cshtml`, `.aspx`, and similar files.
3+
[Sublime Text][st] [syntax highlighting][ss-docs] for `.cshtml`, `.aspx`, and similar files.
44

55
## Current support
66

@@ -14,16 +14,15 @@
1414

1515
- Hotkey comment/uncomment server-side comments (<kbd>Ctrl</kbd>+<kbd>/</kbd> or <kbd>Cmd</kbd>+<kbd>/</kbd>)
1616

17-
- Snippets for `<%` expressions (Try typing `exp`)
18-
+ These are subject to change.
17+
- Snippets for `<%`-ish expressions
1918
- Snippets for some directives (Try `page` or `import`)
2019
+ Default attributes are subject to change.
2120
- Snippets may require <kbd>Ctrl</kbd>+<kbd>space</kbd>, depending on your environment.
2221
- Some autocomplete within directives.
2322

2423
### Razor syntax
2524

26-
Huge thank-you to @keith-hall for this!
25+
A huge thank-you to [@keith-hall][keith] for this!
2726

2827
## Future support (maybe)
2928

@@ -53,5 +52,6 @@ Huge thank-you to @keith-hall for this!
5352
```
5453
5554
[pkg]: https://packagecontrol.io/packages/HTML%20(C%23)
56-
[st3]: https://www.sublimetext.com/
57-
[ss-docs]: https://www.sublimetext.com/docs/3/syntax.html
55+
[st]: https://www.sublimetext.com/
56+
[ss-docs]: https://www.sublimetext.com/docs/syntax.html
57+
[keith]: https://github.com/keith-hall
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ file_extensions:
66
- aspx
77
- ascx
88
- asax
9-
- cshtml
109
- master
11-
scope: embedding.cshtml
10+
scope: embedding.cshtml.aspnet
1211
contexts:
1312
main:
1413
- include: html
@@ -152,6 +151,8 @@ contexts:
152151
- match: ''
153152
set: scope:text.html.basic
154153
with_prototype:
154+
- match: <(?=<)
155+
scope: invalid.illegal.cshtml
155156
- include: comments
156157
- include: script-tag-cs
157158
- include: directive

completions/cshtml.sublime-completions

Lines changed: 0 additions & 16 deletions
This file was deleted.

completions/directives/root.sublime-completions

Lines changed: 0 additions & 19 deletions
This file was deleted.

cshtml.sublime-settings

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"auto_complete_selector": "embedding.cshtml.aspnet - comment",
3+
"auto_complete_triggers": [
4+
{
5+
"characters": "@",
6+
"selector": "embedding.cshtml.razor",
7+
}
8+
]
9+
}

messages/4.0.0.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
v4.0.0 (2020-05-17)
2+
===================
3+
4+
- Add a scope suffix to ASP.Net/WebForms to differentiate from Razor.
5+
6+
+ *Breaking change:* The Razor syntax now "owns" the `.cshtml` file
7+
extension. If you need it bound to WebForms-style pages, use the "Open
8+
all with current extension as..." option from the Syntax selector menu
9+
in the bottom-right.
10+
11+
+ This also means that completions and so on can be more easily targeted at
12+
one or the other syntax.
13+
14+
- Move some completions to snippets
15+
16+
+ *Breaking change:* The `exp*` completions have been removed in favor of
17+
typing the `<%*` expressions themselves.
18+
19+
- Enable autocomplete by default in ASP.Net, and on `@` for Razor.
20+
21+
- Razor gets comment block toggling (although it's not perfect).

messaging.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2+
"4.0.0": "messages/4.0.0.md",
23
"3.0.0": "messages/3.0.0.md"
34
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<string>Comments</string>
66
<key>scope</key>
77
<string>
8-
embedding.cshtml,
9-
embedding.cshtml text.html
8+
embedding.cshtml.aspnet,
9+
embedding.cshtml.aspnet text.html
1010
</string>
1111
<key>settings</key>
1212
<dict>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<snippet>
2+
<scope>embedding.cshtml.aspnet - source.cs</scope>
3+
<tabTrigger>&lt;%</tabTrigger>
4+
<content><![CDATA[<%
5+
${1}
6+
%>]]></content>
7+
<description>&lt;% … %&gt;</description>
8+
</snippet>

0 commit comments

Comments
 (0)