Skip to content

Commit ab5ea47

Browse files
committed
Refactor Razor C# inheritance
1 parent cef9159 commit ab5ea47

4 files changed

Lines changed: 27 additions & 25 deletions

File tree

Razor/C# (Razor).sublime-syntax

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
%YAML 1.2
22
---
3-
scope: source.cs.embedded.html
3+
scope: source.cs.embedded.html.cs.razor
44
hidden: true
55
version: 2
66

@@ -15,3 +15,22 @@ contexts:
1515
scope: invalid.illegal.stray.cs
1616
- match: (?=})
1717
pop: 1
18+
19+
keywords:
20+
- meta_prepend: true
21+
- match: \bModel\b
22+
scope: variable.language.this.razor
23+
- match: \bHtml\b
24+
scope: variable.language.this.razor
25+
26+
inside_triple_quoted_raw_string_syntax:
27+
- meta_include_prototype: false
28+
- include: immediately_pop
29+
30+
inside_verbatim_string_syntax:
31+
- meta_include_prototype: false
32+
- include: immediately_pop
33+
34+
inside_verbatim_format_string_syntax:
35+
- meta_include_prototype: false
36+
- include: immediately_pop

Razor/Razor.sublime-syntax

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ contexts:
9999
- match: \}
100100
scope: punctuation.section.block.end.cs-razor
101101
pop: true
102-
- include: scope:source.cs#code_block_in
102+
- include: Packages/HTML (C#)/Razor/C# (Razor).sublime-syntax#code_block_in
103103
- match: \s*(?!\{)(?=\S)
104104
scope: invalid.illegal.expected-block.cs-razor
105105
pop: true
@@ -111,15 +111,15 @@ contexts:
111111
push:
112112
- clear_scopes: 1
113113
- meta_content_scope: source.cs.embedded.html
114-
- include: scope:source.cs#line_of_code
114+
- include: Packages/HTML (C#)/Razor/C# (Razor).sublime-syntax#line_of_code
115115
- match: ''
116116
pop: true
117117
with_prototype:
118118
- include: razor-block-prototype
119119
- match: '[\w-+]+@\w+' # ignore email addresses
120120
- match: '@(?=(?:\w+\.)*\w+(?:[<\s]|$))'
121121
scope: punctuation.section.embedded.line.cs-razor
122-
embed: scope:source.cs#line_of_code_in
122+
embed: Packages/HTML (C#)/Razor/C# (Razor).sublime-syntax#line_of_code_in
123123
embed_scope: source.cs.embedded.html
124124
escape: $|(?=[<\s])
125125
- match: '@(?=(?:\w+\.)*\w+\()'
@@ -128,7 +128,7 @@ contexts:
128128
- meta_content_scope: source.cs.embedded.html
129129
- match: (?=[<\s])
130130
pop: true
131-
- include: scope:source.cs#line_of_code_in
131+
- include: Packages/HTML (C#)/Razor/C# (Razor).sublime-syntax#line_of_code_in
132132
- match: '@\('
133133
scope: punctuation.section.embedded.begin.cs-razor
134134
push:
@@ -137,7 +137,7 @@ contexts:
137137
- match: \)
138138
scope: punctuation.section.embedded.end.cs-razor
139139
pop: true
140-
- include: scope:source.cs#line_of_code_in
140+
- include: Packages/HTML (C#)/Razor/C# (Razor).sublime-syntax#line_of_code_in
141141
#- match: '@(?=\w+(?:\.\w+)*)(?!\s*[+=|(])' # TODO: support a.b[2] etc.
142142
# comment: property/variable access
143143
# scope: punctuation.section.embedded.line.cs-razor

Razor/embeddings/C# (for C# Razor HTML attribute).sublime-syntax

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,11 @@ scope: source.cs.embedded.html-attribute-string.razor
44
version: 2
55
hidden: true
66

7-
extends: Packages/C#/C#.sublime-syntax
7+
extends: Packages/HTML (C#)/Razor/C# (Razor).sublime-syntax
88

99
contexts:
1010

1111
line_of_code_in:
1212
- meta_prepend: true
1313
- match: (?=")
1414
pop: 1
15-
16-
keywords:
17-
- meta_prepend: true
18-
- match: \bModel\b
19-
scope: variable.language.this.razor
20-
21-
inside_triple_quoted_raw_string_syntax:
22-
- meta_include_prototype: false
23-
- include: immediately_pop
24-
25-
inside_verbatim_string_syntax:
26-
- meta_include_prototype: false
27-
- include: immediately_pop
28-
29-
inside_verbatim_format_string_syntax:
30-
- meta_include_prototype: false
31-
- include: immediately_pop

WebForms/C# (WebForms).sublime-syntax

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
%YAML 1.2
22
---
3-
scope: source.cs.embedded.html
3+
scope: source.cs.embedded.html.cs.webforms
44
hidden: true
55
version: 2
66

0 commit comments

Comments
 (0)