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