Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions packages/svelte-vscode/syntaxes/svelte.tmLanguage.src.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ injections:
patterns:
# Matches the store accessor symbol.
# i.e. the `$` in `$myStore`.
- match: (?<![_$[:alnum:]])\$(?=[_[:alpha:]][_$[:alnum:]]*)
- match: (?<![_$./'"[:alnum:]])\$(?=[_[:alpha:]][_$[:alnum:]]*)
name: punctuation.definition.variable.svelte
# Matches the built-in constants/keywords that Svelte supports.
# e.g. `$$restProps`.
- match: (?<![_$[:alnum:]])(\$\$)(?=props|restProps|slots)
- match: (?<![_$./'"[:alnum:]])(\$\$)(?=props|restProps|slots)
name: punctuation.definition.variable.svelte

# - PUG -
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<script>
import './$types';
import '$lib/foo';
$bar;
</script>

{$bar}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
><script>
#^ source.svelte meta.script.svelte meta.tag.start.svelte punctuation.definition.tag.begin.svelte
# ^^^^^^ source.svelte meta.script.svelte meta.tag.start.svelte entity.name.tag.svelte
# ^ source.svelte meta.script.svelte meta.tag.start.svelte punctuation.definition.tag.end.svelte
>import './$types';
#^^^^^^^^^^^^^^^^^^^ source.svelte meta.script.svelte meta.embedded.block.svelte source.js
>import '$lib/foo';
#^^^^^^^^^^^^^^^^^^^ source.svelte meta.script.svelte meta.embedded.block.svelte source.js
>$bar;
#^ source.svelte meta.script.svelte meta.embedded.block.svelte source.js punctuation.definition.variable.svelte
# ^^^^^ source.svelte meta.script.svelte meta.embedded.block.svelte source.js
></script>
#^^ source.svelte meta.script.svelte meta.tag.end.svelte punctuation.definition.tag.begin.svelte
# ^^^^^^ source.svelte meta.script.svelte meta.tag.end.svelte entity.name.tag.svelte
# ^ source.svelte meta.script.svelte meta.tag.end.svelte punctuation.definition.tag.end.svelte
>
>{$bar}
#^ source.svelte punctuation.section.embedded.begin.svelte
# ^ source.svelte meta.embedded.expression.svelte source.ts punctuation.definition.variable.svelte
# ^^^ source.svelte meta.embedded.expression.svelte source.ts
# ^ source.svelte punctuation.section.embedded.end.svelte
>