From d9be302f7499c203ab274bc2b37f11150a2f8834 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Mon, 7 Aug 2023 13:42:24 +0100 Subject: [PATCH] fix(spell): do not spell check certain types of strings (#5203) - Document that only certain kinds of strings are spell checked, and reasons why they may not. - Remove spell checking for bash strings. --- CONTRIBUTING.md | 4 ++++ queries/bash/highlights.scm | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f2e96bc1a..2d06c3525 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -239,6 +239,10 @@ Used for XML-like tags. @nospell ; for defining regions that should NOT be spellchecked ``` +The main types of nodes which are spell checked are: +- Comments +- Strings; where it makes sense. Strings that have interpolation or are typically used for non text purposes are not spell checked (e.g. bash). + #### Priority Captures can be assigned a priority to control precedence of highlights via the diff --git a/queries/bash/highlights.scm b/queries/bash/highlights.scm index 23bf03e69..063c2b920 100644 --- a/queries/bash/highlights.scm +++ b/queries/bash/highlights.scm @@ -40,12 +40,15 @@ "!=" ] @operator +; Do *not* spell check strings since they typically have some sort of +; interpolation in them, or, are typically used for things like filenames, URLs, +; flags and file content. [ (string) (raw_string) (ansi_c_string) (heredoc_body) -] @string @spell +] @string (variable_assignment (word) @string)