Skip to content

Commit e7476b1

Browse files
authored
(fix) highlighting for modifiers (#795)
#793
1 parent c9c6ea7 commit e7476b1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/svelte-vscode/syntaxes/svelte.tmLanguage.src.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,14 +382,15 @@ repository:
382382
# Matches Svelte element directives, e.g. `on:click|preventDefault={var}`
383383
attributes-directives:
384384
# If something is added to attributes-directives-keywords, it must be added to the begin-regex, too.
385-
begin: (?<!<)(on|use|bind|transition|in|out|animate|let|class)(:)([_$[:alpha:]][_\-$[:alnum:]]*)((?:\|.*)?\|\w*)?
385+
begin: (?<!<)(on|use|bind|transition|in|out|animate|let|class)(:)([_$[:alpha:]][_\-$[:alnum:]]*)((\|\w+)*)
386386
beginCaptures:
387387
1: { patterns: [ include: '#attributes-directives-keywords' ] }
388388
2: { name: punctuation.definition.keyword.svelte }
389389
3: { patterns: [ include: '#attributes-directives-types' ] }
390390
4: { patterns: [
391-
{ match: '[^\|]', name: support.function.svelte },
392-
{ match: '\|', name: punctuation.separator.svelte }]}
391+
{ match: '\w+', name: support.function.svelte },
392+
{ match: '\|', name: punctuation.separator.svelte }
393+
]}
393394
end: (?=\s*+[^=\s])
394395
name: meta.directive.$1.svelte
395396
patterns:

0 commit comments

Comments
 (0)