Skip to content

Commit d1888ca

Browse files
committed
Rename root scope to embedding like PHP
This lets people set color schemes that show embedding without being overly cluttered.
1 parent 8120211 commit d1888ca

7 files changed

Lines changed: 15 additions & 11 deletions

Comments.tmPreferences

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<key>name</key>
55
<string>Comments</string>
66
<key>scope</key>
7-
<string>text.html.cshtml</string>
7+
<string>embedding.cshtml</string>
88
<key>settings</key>
99
<dict>
1010
<key>shellVariables</key>

ashx.sublime-syntax

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ name: .Net Web Handler (ASHX)
55
first_line_match: <%@\s*WebHandler
66
file_extensions:
77
- ashx
8-
scope: source.cs.ashx
8+
scope: embedding.ashx
99
contexts:
1010
main:
1111
- match: ''
1212
set: scope:source.cs
1313
with_prototype:
14-
- include: directive-type
1514
- include: directive
1615

1716
directive-generic-attribute:

completions/cshtml.sublime-completions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"scope": "text.html.cshtml - source.cs",
2+
"scope": "embedding.cshtml - source.cs",
33
"completions": [
44
// Expressions
55
{ "trigger": "exp\t<%= … %>", "contents": "<%= ${1:Object} %>"},

completions/directives/OutputCache.sublime-completions

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
// https://msdn.microsoft.com/en-us/library/hdxfb6cy(v=vs.100).aspx
3-
"scope": "text.html.cshtml meta.block.processing-directive.contents.outputcache",
3+
"scope": "embedding.cshtml meta.block.processing-directive.contents.outputcache",
44
"completions": [
55
{ "trigger": "Duration\tOutputCache", "contents": "Duration=\"${1:120}\" " },
66
{ "trigger": "Location\tOutputCache", "contents": "Location=\"${1:Any | Client | Downstream | Server | None | ServerAndClient}\" " },
@@ -12,7 +12,7 @@
1212
{ "trigger": "VaryByContentEncoding\tOutputCache", "contents": "VaryByContentEncoding=\"${1:Encoding}\" " },
1313
{ "trigger": "CacheProfile\tOutputCache", "contents": "CacheProfile=\"${1:CacheProfileName}\" " },
1414
{ "trigger": "NoStore\tOutputCache", "contents": "NoStore=\"${1:true}\" " },
15-
{ "trigger": "SqlDependency\tOutputCache", "contents": "SqlDependency=\"${1:${2:DatabaseName}:${2:TableName}\" " },
15+
{ "trigger": "SqlDependency\tOutputCache", "contents": "SqlDependency=\"${1:${2:DatabaseName}:${3:TableName}}\" " },
1616
{ "trigger": "ProviderName\tOutputCache", "contents": "ProviderName=\"${1:ProviderName}\" " },
1717
]
1818
}

completions/directives/root.sublime-completions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
// https://msdn.microsoft.com/en-us/library/xz702w3e(v=vs.100).aspx
3-
"scope": "text.html.cshtml meta.block.processing-directive - meta.block.processing-directive.contents",
3+
"scope": "embedding.cshtml meta.block.processing-directive - meta.block.processing-directive.contents",
44
"completions": [
55
{ "trigger": "Application\tDirective", "contents": "Application" },
66
{ "trigger": "Page\tDirective", "contents": "Page" },

cshtml.sublime-syntax

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ file_extensions:
88
- asax
99
- cshtml
1010
- master
11-
scope: text.html.cshtml
11+
scope: embedding.cshtml
1212
contexts:
1313
main:
1414
- include: html
@@ -185,7 +185,6 @@ contexts:
185185
9: punctuation.definition.string.begin.cshtml
186186
10: punctuation.definition.string.end.cshtml
187187
push:
188-
- meta_content_scope: source.cs.embedded.html
189188
- match: (?i)(</)(script)(>)
190189
captures:
191190
1: punctuation.definition.tag.begin.html
@@ -195,6 +194,7 @@ contexts:
195194
- match: '>'
196195
scope: punctuation.definition.tag.end.html
197196
embed: scope:source.cs
197+
embed_scope: source.cs.embedded.html
198198
escape: (?i)(?=</script)
199199
- include: scope:text.html.basic#tag-stuff
200200

tests/syntax_test_aspx.aspx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
// ^^^^^^^^ string.quoted.double.cshtml
5353
// ^ punctuation.definition.string.begin.cshtml
5454
// ^ punctuation.definition.string.end.cshtml
55+
// ^^^^^^^^^^^^^^^ - source.cs.embedded.html
5556
// ^^^^^^^^ entity.other.attribute-name
5657
// ^ punctuation.separator.key-value
5758
// ^^^^ string.quoted.double
@@ -74,8 +75,12 @@
7475
foo += foo;
7576
}
7677
}
77-
</script>
78-
// ^^^^^^^^^ - source.cs.embedded.html
78+
</script>
79+
// <- source.cs.embedded.html
80+
// ^^ punctuation.definition.tag.begin.html
81+
// ^^^^^^ entity.name.tag.html
82+
// ^ punctuation.definition.tag.end.html
83+
// ^^^^^^^^^^ - source.cs.embedded.html
7984

8085
<!DOCTYPE html>
8186
<html>

0 commit comments

Comments
 (0)