aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2023-08-07 13:42:24 +0100
committerGitHub <noreply@github.com>2023-08-07 13:42:24 +0100
commitd9be302f7499c203ab274bc2b37f11150a2f8834 (patch)
treec4a864913a8da54fdb4e7f0aaf40fb88ed7b7a27
parentUpdate parsers: wing (diff)
downloadnvim-treesitter-d9be302f7499c203ab274bc2b37f11150a2f8834.tar
nvim-treesitter-d9be302f7499c203ab274bc2b37f11150a2f8834.tar.gz
nvim-treesitter-d9be302f7499c203ab274bc2b37f11150a2f8834.tar.bz2
nvim-treesitter-d9be302f7499c203ab274bc2b37f11150a2f8834.tar.lz
nvim-treesitter-d9be302f7499c203ab274bc2b37f11150a2f8834.tar.xz
nvim-treesitter-d9be302f7499c203ab274bc2b37f11150a2f8834.tar.zst
nvim-treesitter-d9be302f7499c203ab274bc2b37f11150a2f8834.zip
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.
-rw-r--r--CONTRIBUTING.md4
-rw-r--r--queries/bash/highlights.scm5
2 files changed, 8 insertions, 1 deletions
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)