From c320a8b1aabea7fbb752ec046d0d2f1772209a86 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Sun, 24 Nov 2024 01:45:56 +0100 Subject: [PATCH] [HTML] Restrict main HTML snippet (#4084) This commit disables `html` snippet in ... - comments - literal or interpolated strings - embedded or interpolated code blocks (from template languages) - HTML tags - Markdown files (but not in fenced code blocks) Using `- text.html ` in order to only exclude scopes belonging to possibly embedded HTML code block in question. This is required to enable snippets if HTML is embedded in `source` code, source.astro text.html but disable it in embedded CSS/JS or any other source code. text.html source.css --- HTML/Snippets/html (begin tag).sublime-snippet | 5 ++++- HTML/Snippets/html.sublime-snippet | 13 ++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/HTML/Snippets/html (begin tag).sublime-snippet b/HTML/Snippets/html (begin tag).sublime-snippet index f64bf4fb87..d7382fc72a 100644 --- a/HTML/Snippets/html (begin tag).sublime-snippet +++ b/HTML/Snippets/html (begin tag).sublime-snippet @@ -11,6 +11,9 @@ $0 ]]> html - text.html entity.name.tag, text.html meta.character.less-than + + (text.html entity.name.tag, text.html meta.character.less-than) + - (text.html.markdown - markup.raw.code-fence text.html) + html diff --git a/HTML/Snippets/html.sublime-snippet b/HTML/Snippets/html.sublime-snippet index b423ad5128..2ed09fbb90 100644 --- a/HTML/Snippets/html.sublime-snippet +++ b/HTML/Snippets/html.sublime-snippet @@ -11,6 +11,17 @@ $0 ]]> html - text.html - (meta.tag | meta.character.less-than) - source.php + + text.html + - text.html meta.tag + - text.html meta.character.less-than + - text.html meta.embedded + - text.html meta.interpolation + - text.html meta.string + - text.html source + - text.html comment + - text.html string + - (text.html.markdown - markup.raw.code-fence text.html) + html