From 9f17f564f568c646a7155cd05e7bf19cd003755e Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Thu, 19 Nov 2020 10:13:13 +0100 Subject: [PATCH 1/2] (fix) syntag highlighting Fix special svelte attributes highlighting by listing them out instead of using a generic \w+ regex. No longer treats "superon:click" as a special svelte attribute and highlights accordingly. --- packages/svelte-vscode/syntaxes/svelte.tmLanguage.src.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/svelte-vscode/syntaxes/svelte.tmLanguage.src.yaml b/packages/svelte-vscode/syntaxes/svelte.tmLanguage.src.yaml index 51d0efccb..7ee5180de 100644 --- a/packages/svelte-vscode/syntaxes/svelte.tmLanguage.src.yaml +++ b/packages/svelte-vscode/syntaxes/svelte.tmLanguage.src.yaml @@ -364,7 +364,8 @@ repository: # For Svelte element directives. Scopes the 'on' part in `on:click`. attributes-directives-keywords: patterns: - # If other keywords are patched in in the future, they can easily be added here. + # If other keywords are patched in in the future, they can be added here but also need to be added + # where attributes-directives-keywords is included. - { match: on|use|bind, name: keyword.control.svelte } - { match: transition|in|out|animate, name: keyword.other.animation.svelte } - { match: let, name: storage.type.svelte } @@ -385,7 +386,8 @@ repository: # Matches Svelte element directives, e.g. `on:click|preventDefault={var}` attributes-directives: - begin: (? Date: Thu, 19 Nov 2020 11:02:01 +0100 Subject: [PATCH 2/2] Fix highlighting for empty style/script/template tag by adding a "not immediately followed by .svelte (meta.lang. | meta.lang. | ...) - (meta source)' - # patterns: [{begin: '(?<=>)', end: '(?=)(?!, patterns: [{ include: source. }]}] # Script Languages # JavaScript | 'javascript' | 'source.js' 'L:meta.script.svelte meta.lang.javascript - (meta source)': - patterns: [{begin: '(?<=>)', end: '(?=)(?!)', end: '(?=)(?!)', end: '(?=)(?!)', end: '(?=)(?!)', end: '(?=)(?!)', end: '(?=)(?!)', end: '(?=)(?!)', end: '(?=)(?!)', end: '(?=)(?!)', end: '(?=)(?!)', end: '(?=)(?!)', end: '(?=)(?!)', end: '(?=)(?!