Skip to content

Commit 15fd188

Browse files
deathaxeskyronic
authored andcommitted
Reorganize lang-attribute contexts
This commit applies a structural change from HTML.sublime-syntax, which turns various "lang" attribute related anonymous contexts into named contexts as those help debugging syntax errors when using ST's new scope name popup. They also help inheriting syntaxes more fine grained.
1 parent a97625d commit 15fd188

File tree

2 files changed

+84
-54
lines changed

2 files changed

+84
-54
lines changed

Vue Component.sublime-syntax

Lines changed: 42 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,20 @@ contexts:
160160
style-lang-attribute:
161161
- match: (?i:lang){{attribute_name_break}}
162162
scope: meta.attribute-with-value.html entity.other.attribute-name.html
163-
set:
164-
- meta_content_scope: meta.tag.style.begin.html meta.attribute-with-value.html
165-
- match: =
166-
scope: punctuation.separator.key-value.html
167-
set:
168-
- meta_scope: meta.tag.style.begin.html meta.attribute-with-value.html
169-
- include: style-lang-decider
170-
- match: (?=\S)
171-
set: style-css
163+
set: style-lang-attribute-assignment
164+
165+
style-lang-attribute-assignment:
166+
- meta_content_scope: meta.tag.style.begin.html meta.attribute-with-value.html
167+
- match: =
168+
scope: punctuation.separator.key-value.html
169+
set: style-lang-attribute-value
170+
- match: (?=\S)
171+
set: style-css
172+
173+
style-lang-attribute-value:
174+
- meta_include_prototype: false
175+
- meta_scope: meta.tag.style.begin.html meta.attribute-with-value.html
176+
- include: style-lang-decider
172177

173178
style-lang-decider:
174179
- match: (?i)(?=sass{{unquoted_attribute_break}}|\'sass\'|"sass")
@@ -352,15 +357,20 @@ contexts:
352357
script-lang-attribute:
353358
- match: (?i:lang){{attribute_name_break}}
354359
scope: meta.attribute-with-value.html entity.other.attribute-name.html
355-
set:
356-
- meta_content_scope: meta.tag.script.begin.html meta.attribute-with-value.html
357-
- match: =
358-
scope: punctuation.separator.key-value.html
359-
set:
360-
- meta_scope: meta.tag.script.begin.html meta.attribute-with-value.html
361-
- include: script-lang-decider
362-
- match: (?=\S)
363-
set: script-javascript
360+
set: script-lang-attribute-assignment
361+
362+
script-lang-attribute-assignment:
363+
- meta_content_scope: meta.tag.script.begin.html meta.attribute-with-value.html
364+
- match: =
365+
scope: punctuation.separator.key-value.html
366+
set: script-lang-attribute-value
367+
- match: (?=\S)
368+
set: script-javascript
369+
370+
script-lang-attribute-value:
371+
- meta_include_prototype: false
372+
- meta_scope: meta.tag.script.begin.html meta.attribute-with-value.html
373+
- include: script-lang-decider
364374

365375
script-lang-decider:
366376
- match: (?i)(?=coffee{{unquoted_attribute_break}}|\'coffee\'|"coffee")
@@ -464,15 +474,20 @@ contexts:
464474
template-lang-attribute:
465475
- match: (?i:lang){{attribute_name_break}}
466476
scope: meta.attribute-with-value.html entity.other.attribute-name.html
467-
set:
468-
- meta_content_scope: meta.tag.template.begin.html meta.attribute-with-value.html
469-
- match: =
470-
scope: punctuation.separator.key-value.html
471-
set:
472-
- meta_scope: meta.tag.template.begin.html meta.attribute-with-value.html
473-
- include: template-lang-decider
474-
- match: (?=\S)
475-
set: template-mustache
477+
set: template-lang-attribute-assignment
478+
479+
template-lang-attribute-assignment:
480+
- meta_content_scope: meta.tag.template.begin.html meta.attribute-with-value.html
481+
- match: =
482+
scope: punctuation.separator.key-value.html
483+
set: template-lang-attribute-value
484+
- match: (?=\S)
485+
set: template-mustache
486+
487+
template-lang-attribute-value:
488+
- meta_include_prototype: false
489+
- meta_scope: meta.tag.template.begin.html meta.attribute-with-value.html
490+
- include: template-lang-decider
476491

477492
template-lang-decider:
478493
- match: (?i)(?=jade{{unquoted_attribute_break}}|\'jade\'|"jade")

Vue Component.sublime-syntax.yaml-macros

Lines changed: 42 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -169,15 +169,20 @@ contexts:
169169
style-lang-attribute:
170170
- match: (?i:lang){{attribute_name_break}}
171171
scope: meta.attribute-with-value.html entity.other.attribute-name.html
172-
set:
173-
- meta_content_scope: meta.tag.style.begin.html meta.attribute-with-value.html
174-
- match: =
175-
scope: punctuation.separator.key-value.html
176-
set:
177-
- meta_scope: meta.tag.style.begin.html meta.attribute-with-value.html
178-
- include: style-lang-decider
179-
- match: (?=\S)
180-
set: style-css
172+
set: style-lang-attribute-assignment
173+
174+
style-lang-attribute-assignment:
175+
- meta_content_scope: meta.tag.style.begin.html meta.attribute-with-value.html
176+
- match: =
177+
scope: punctuation.separator.key-value.html
178+
set: style-lang-attribute-value
179+
- match: (?=\S)
180+
set: style-css
181+
182+
style-lang-attribute-value:
183+
- meta_include_prototype: false
184+
- meta_scope: meta.tag.style.begin.html meta.attribute-with-value.html
185+
- include: style-lang-decider
181186

182187
style-lang-decider:
183188
- !style_language [ sass, source.sass ]
@@ -235,15 +240,20 @@ contexts:
235240
script-lang-attribute:
236241
- match: (?i:lang){{attribute_name_break}}
237242
scope: meta.attribute-with-value.html entity.other.attribute-name.html
238-
set:
239-
- meta_content_scope: meta.tag.script.begin.html meta.attribute-with-value.html
240-
- match: =
241-
scope: punctuation.separator.key-value.html
242-
set:
243-
- meta_scope: meta.tag.script.begin.html meta.attribute-with-value.html
244-
- include: script-lang-decider
245-
- match: (?=\S)
246-
set: script-javascript
243+
set: script-lang-attribute-assignment
244+
245+
script-lang-attribute-assignment:
246+
- meta_content_scope: meta.tag.script.begin.html meta.attribute-with-value.html
247+
- match: =
248+
scope: punctuation.separator.key-value.html
249+
set: script-lang-attribute-value
250+
- match: (?=\S)
251+
set: script-javascript
252+
253+
script-lang-attribute-value:
254+
- meta_include_prototype: false
255+
- meta_scope: meta.tag.script.begin.html meta.attribute-with-value.html
256+
- include: script-lang-decider
247257

248258
script-lang-decider:
249259
- !script_language [ coffee, source.coffee ]
@@ -284,15 +294,20 @@ contexts:
284294
template-lang-attribute:
285295
- match: (?i:lang){{attribute_name_break}}
286296
scope: meta.attribute-with-value.html entity.other.attribute-name.html
287-
set:
288-
- meta_content_scope: meta.tag.template.begin.html meta.attribute-with-value.html
289-
- match: =
290-
scope: punctuation.separator.key-value.html
291-
set:
292-
- meta_scope: meta.tag.template.begin.html meta.attribute-with-value.html
293-
- include: template-lang-decider
294-
- match: (?=\S)
295-
set: template-mustache
297+
set: template-lang-attribute-assignment
298+
299+
template-lang-attribute-assignment:
300+
- meta_content_scope: meta.tag.template.begin.html meta.attribute-with-value.html
301+
- match: =
302+
scope: punctuation.separator.key-value.html
303+
set: template-lang-attribute-value
304+
- match: (?=\S)
305+
set: template-mustache
306+
307+
template-lang-attribute-value:
308+
- meta_include_prototype: false
309+
- meta_scope: meta.tag.template.begin.html meta.attribute-with-value.html
310+
- include: template-lang-decider
296311

297312
template-lang-decider:
298313
- !template_language [ jade, text.jade ]

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy