Skip to content

Commit

Permalink
(fix) syntax highlighting for self-closing
Browse files Browse the repository at this point in the history
- Fix highlighting break when there's no space between `name` and `/` (#773 )
- `/` is now part of `...definition.tag.end.svelte`
  • Loading branch information
dummdidumm committed Jan 24, 2021
1 parent 8abeb0f commit 85eef1d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/svelte-vscode/syntaxes/svelte.tmLanguage.src.yaml
Expand Up @@ -431,21 +431,19 @@ repository:
tags-start-attributes:
begin: \G
end: (?=/?>)
endCaptures: { 0: { name: punctuation.definition.tag.end.svelte } }
name: meta.tag.start.svelte
patterns: [ include: '#attributes' ]

# Same as tags-start-attributes but slightly adjusted for special script/style/template tags.
tags-lang-start-attributes:
begin: \G
end: (?=/>)|>
endCaptures: { 0: { name: punctuation.definition.tag.end.svelte } }
name: meta.tag.start.svelte
patterns: [ include: '#attributes' ]

# Matches the beginning (`<name`) section of a tag start node.
tags-start-node:
match: (<)([^/\s>]*)
match: (<)([^/\s>/]*)
captures:
1: { name: punctuation.definition.tag.begin.svelte }
2: { patterns: [ include: '#tags-name' ] }
Expand Down Expand Up @@ -496,8 +494,8 @@ repository:
# Split up into start and end because we don't need to preserve the name
# inside and because it makes whitespace matching logic more robust
tags-general-start:
begin: (<)([^/\s>]*)
end: (>)
begin: (<)([^/\s>/]*)
end: (/?>)
beginCaptures: { 0: { patterns: [ include: '#tags-start-node' ] } }
endCaptures:
1: { name: meta.tag.start.svelte punctuation.definition.tag.end.svelte }
Expand Down

0 comments on commit 85eef1d

Please sign in to comment.