-
Notifications
You must be signed in to change notification settings - Fork 5
/
ashx.sublime-syntax
56 lines (51 loc) · 1.78 KB
/
ashx.sublime-syntax
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: .Net Web Handler (ASHX)
first_line_match: <%@\s*WebHandler
file_extensions:
- ashx
scope: embedding.ashx
contexts:
main:
- match: ''
set: scope:source.cs
with_prototype:
- include: directive
directive-generic-attribute:
- match: '\b(\w+)\s*(=)\s*((")[^"]*("))\s*'
captures:
1: entity.other.attribute-name.cshtml
2: punctuation.separator.key-value.cshtml
3: string.quoted.double.cshtml
4: punctuation.definition.string.begin.cshtml
5: punctuation.definition.string.end.cshtml
directive-end:
- match: '%>'
scope: punctuation.section.embedded.end.cshtml
pop: true
directive:
# https://msdn.microsoft.com/en-us/library/xz702w3e(v=vs.100).aspx
- match: '<%@'
scope: punctuation.section.embedded.begin.cshtml
set:
- meta_scope: meta.block.processing-directive.cshtml
- include: directive-type
- include: directive-other
- include: directive-end
directive-type:
# https://msdn.microsoft.com/en-us/library/ms366713(v=vs.100).aspx
- match: '\b(?i:WebHandler)\b'
scope: constant.language.processing-directive.type.cshtml entity.name.class.cs
set:
- meta_scope: meta.block.processing-directive.contents.type.cshtml
- include: directive-generic-attribute
- include: directive-end
directive-other:
# https://msdn.microsoft.com/en-us/library/xz702w3e(v=vs.100).aspx
- match: '\b(?i:Import|Implements|Assembly|OutputCache|Reference)\b'
scope: punctuation.section.embedded.begin.cshtml
push:
- meta_scope: meta.block.processing-directive.contents.cshtml
- include: directive-generic-attribute
- include: directive-end