Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion packages/svelte-vscode/syntaxes/svelte.tmLanguage.src.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ repository:
{ match: each|key, name: keyword.control.svelte },
{ match: await|then|catch, name: keyword.control.flow.svelte },
{ match: html, name: keyword.other.svelte },
{ match: debug, name: keyword.other.debugger.svelte }]}
{ match: debug, name: keyword.other.debugger.svelte },
{ match: const, name: storage.type.svelte }]}

# Scopes special tag _block start nodes_ depending on what type they are, such as `#if` or `#await` blocks.
special-tags-modes:
Expand All @@ -225,6 +226,19 @@ repository:
name: meta.embedded.expression.svelte source.ts
patterns: [ include: source.ts ]

# Const.
- begin: (?<=const.*?)\G
end: (?=})
patterns:
# Variable.
- begin: \G\s*([_$[:alpha:]][_$[:alnum:]]+)\s*
end: (?=\=)
beginCaptures: { 1: { name: variable.other.constant.svelte } }
# Expression (starting with "=").
- begin: (?=\=)
end: (?=})
patterns: [ include: source.ts#variable-initializer ]

# Each.
- begin: (?<=each.*?)\G
end: (?=})
Expand Down