summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2022-09-06 11:56:27 +0100
committerLewis Russell <me@lewisr.dev>2022-09-06 12:44:19 +0100
commit2a63ea5665a6de96acd31a045d9d4d73272ff5a9 (patch)
tree348be916a4d33581fd2703d88878dd33fd625741
parent3e09c81b4c33bf14907b8a59025904d14c234b1e (diff)
feat(spell): upstream spell queries from spellsitter
-rw-r--r--CONTRIBUTING.md4
-rw-r--r--queries/c/highlights.scm1
-rw-r--r--queries/elixir/highlights.scm2
-rw-r--r--queries/go/highlights.scm8
-rw-r--r--queries/json/highlights.scm1
-rw-r--r--queries/latex/highlights.scm7
-rw-r--r--queries/markdown/highlights.scm2
-rw-r--r--queries/perl/highlights.scm1
-rw-r--r--queries/python/highlights.scm4
-rw-r--r--queries/rst/highlights.scm11
-rw-r--r--queries/ruby/highlights.scm2
-rw-r--r--queries/rust/highlights.scm5
-rw-r--r--queries/teal/highlights.scm1
13 files changed, 49 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 4b1bbebd..75ff4559 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -206,6 +206,10 @@ Used for xml-like tags
@conceal followed by `(#set! conceal "")` for captures that are not used for highlights but only for concealing.
+#### Spell
+
+@spell for defining regions to be spellchecked.
+
### Locals
```
diff --git a/queries/c/highlights.scm b/queries/c/highlights.scm
index 30b9f941..24c00821 100644
--- a/queries/c/highlights.scm
+++ b/queries/c/highlights.scm
@@ -167,6 +167,7 @@
name: (identifier) @function.macro)
(comment) @comment
+(comment) @spell
;; Parameters
(parameter_declaration
diff --git a/queries/elixir/highlights.scm b/queries/elixir/highlights.scm
index ab304374..fdb92ef3 100644
--- a/queries/elixir/highlights.scm
+++ b/queries/elixir/highlights.scm
@@ -30,9 +30,11 @@
; Comments
(comment) @comment
+(comment) @spell
; Strings
(string) @string
+(string) @spell
; Modules
(alias) @type
diff --git a/queries/go/highlights.scm b/queries/go/highlights.scm
index 3d261f52..d68284ed 100644
--- a/queries/go/highlights.scm
+++ b/queries/go/highlights.scm
@@ -186,6 +186,7 @@
(interpreted_string_literal) @string
(raw_string_literal) @string
+(raw_string_literal) @spell
(rune_literal) @string
(escape_sequence) @string.escape
@@ -202,5 +203,12 @@
(field_declaration name: (field_identifier) @field)
(comment) @comment
+(comment) @spell
(ERROR) @error
+
+((interpreted_string_literal) @spell
+ (#not-has-parent? @spell
+ import_spec
+ )
+)
diff --git a/queries/json/highlights.scm b/queries/json/highlights.scm
index 1ac77898..f41b44a5 100644
--- a/queries/json/highlights.scm
+++ b/queries/json/highlights.scm
@@ -6,6 +6,7 @@
(pair value: (string) @string)
(array (string) @string)
(string_content (escape_sequence) @string.escape)
+(string_content) @spell
(ERROR) @error
["," ":"] @punctuation.delimiter
"[" @punctuation.bracket
diff --git a/queries/latex/highlights.scm b/queries/latex/highlights.scm
index 74edcafa..7703b239 100644
--- a/queries/latex/highlights.scm
+++ b/queries/latex/highlights.scm
@@ -234,3 +234,10 @@
command: _ @include
paths: (curly_group_path_list) @string)
+(
+ (text) @spell
+ (#not-has-parent? @spell
+ inline_formula
+ displayed_equation
+ )
+)
diff --git a/queries/markdown/highlights.scm b/queries/markdown/highlights.scm
index 4cc81f9e..914c34a4 100644
--- a/queries/markdown/highlights.scm
+++ b/queries/markdown/highlights.scm
@@ -56,3 +56,5 @@
(fenced_code_block_delimiter)
] @conceal
(#set! conceal ""))
+
+(inline) @spell
diff --git a/queries/perl/highlights.scm b/queries/perl/highlights.scm
index 2c0e1ba3..c355dbb8 100644
--- a/queries/perl/highlights.scm
+++ b/queries/perl/highlights.scm
@@ -83,6 +83,7 @@
; Comments are comments
(comments) @comment
+(comments) @spell
; POD should be handled specially with its own embedded subtype but for now
; we'll just have to do this.
diff --git a/queries/python/highlights.scm b/queries/python/highlights.scm
index 5e2c4de6..f14e29f2 100644
--- a/queries/python/highlights.scm
+++ b/queries/python/highlights.scm
@@ -141,6 +141,7 @@
(float) @float
(comment) @comment
+(comment) @spell
(string) @string
[
(escape_sequence)
@@ -148,6 +149,9 @@
"}}"
] @string.escape
+; doc-strings
+(expression_statement (string) @spell)
+
; Tokens
[
diff --git a/queries/rst/highlights.scm b/queries/rst/highlights.scm
index 09389102..0e5c346b 100644
--- a/queries/rst/highlights.scm
+++ b/queries/rst/highlights.scm
@@ -158,6 +158,17 @@
(title) @text.title
(comment) @comment
+(comment) @spell
(comment "..") @comment
+(directive
+ name: (type) @_directive
+ body: (body
+ (content) @spell
+ (#not-match? @_directive "code-block")
+ )
+)
+
+(paragraph) @spell
+
(ERROR) @error
diff --git a/queries/ruby/highlights.scm b/queries/ruby/highlights.scm
index 0c593343..5eb2522f 100644
--- a/queries/ruby/highlights.scm
+++ b/queries/ruby/highlights.scm
@@ -162,6 +162,8 @@
] @boolean
(comment) @comment
+(comment) @spell
+(string_content) @spell
; Operators
diff --git a/queries/rust/highlights.scm b/queries/rust/highlights.scm
index fabe32e9..0e6c757d 100644
--- a/queries/rust/highlights.scm
+++ b/queries/rust/highlights.scm
@@ -146,6 +146,11 @@
(block_comment)
] @comment
+[
+ (line_comment)
+ (block_comment)
+] @spell
+
(boolean_literal) @boolean
(integer_literal) @number
(float_literal) @float
diff --git a/queries/teal/highlights.scm b/queries/teal/highlights.scm
index c12fcb53..045fd05f 100644
--- a/queries/teal/highlights.scm
+++ b/queries/teal/highlights.scm
@@ -2,6 +2,7 @@
;; Primitives
(boolean) @boolean
(comment) @comment
+(comment) @spell
(shebang_comment) @comment
(identifier) @variable
((identifier) @variable.builtin