Skip to content

Commit 58d28ca

Browse files
committed
fix: highlight type annotation in @const tags
#2690
1 parent 59796de commit 58d28ca

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

+6-1
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,13 @@ repository:
246246
- include: '#destructuring-const'
247247
# Variable.
248248
- begin: \G\s*([_$[:alpha:]][_$[:alnum:]]+)\s*
249-
end: (?=\=)
249+
end: (?=[:=])
250250
beginCaptures: { 1: { name: variable.other.constant.svelte } }
251+
# Type annotation (starting with ":").
252+
- begin: (?=:)
253+
end: (?=\=)
254+
name: meta.type.annotation.svelte
255+
patterns: [ include: source.ts ]
251256
# Expression (starting with "=").
252257
- begin: (?=\=)
253258
name: meta.embedded.expression.svelte source.ts

0 commit comments

Comments
 (0)