Skip to content

Commit e1b39e7

Browse files
committed
Refactor Razor C# inheritance
1 parent 74b49bc commit e1b39e7

4 files changed

Lines changed: 31 additions & 20 deletions

File tree

Razor/C# (Razor).sublime-syntax

Lines changed: 24 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

@@ -33,3 +33,26 @@ contexts:
3333
scope: invalid.illegal.stray.cs
3434
- match: (?=})
3535
pop: 1
36+
37+
keywords:
38+
- meta_prepend: true
39+
- match: \bModel\b
40+
scope: variable.language.this.razor
41+
- match: \bHtml\b
42+
scope: variable.language.this.razor
43+
44+
inside_triple_quoted_raw_string_syntax:
45+
- meta_include_prototype: false
46+
- include: immediately_pop
47+
48+
inside_verbatim_string_syntax:
49+
- meta_include_prototype: false
50+
- include: immediately_pop
51+
52+
inside_verbatim_format_string_syntax:
53+
- meta_include_prototype: false
54+
- include: immediately_pop
55+
56+
immediately_pop:
57+
- match: ''
58+
pop: 1

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 & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,11 @@ scope: source.cs.embedded.html-attribute-string.razor
44
version: 1
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-
inside_triple_quoted_raw_string_syntax:
17-
- meta_include_prototype: false
18-
- include: immediately_pop
19-
20-
inside_verbatim_string_syntax:
21-
- meta_include_prototype: false
22-
- include: immediately_pop
23-
24-
inside_verbatim_format_string_syntax:
25-
- meta_include_prototype: false
26-
- 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)