refactor: Remove all (ERROR) @error captures

As discussed in PR#5421, capturing `@error` is inconsistent, requiring
deep nesting (or priority) in order to correctly have red backgrounds to
it.

Some queries has this capture, some don't. For consistency purposes,
removing all of them is more preferable.

For re-enabling error, either add `(ERROR) @error` or `(ERROR _ @error)`
to your custom queries.
This commit is contained in:
Pham Huy Hoang 2023-10-25 16:45:14 +09:00 committed by Christian Clason
parent 44762abc90
commit 107e61afb7
80 changed files with 0 additions and 215 deletions

View file

@ -188,9 +188,3 @@
(enumeration_type_definition
(identifier)
. (comment) @comment.documentation)
;; Highlight errors in red. This is not very useful in practice, as text will
;; be highlighted as user types, and the error could be elsewhere in the code.
;; This also requires defining :hi @error guifg=Red for instance.
(ERROR) @error

View file

@ -356,5 +356,3 @@
"bytes" "bytearray" "memoryview" "set" "frozenset" "dict" "type" "object"))
(comment) @comment @spell
(ERROR) @error

View file

@ -282,5 +282,3 @@
(ms_pointer_modifier)
(attribute_declaration)
] @attribute
(ERROR) @error

View file

@ -332,7 +332,3 @@
; Comment
(comment) @comment @spell
; Errors
(ERROR) @error

View file

@ -148,7 +148,3 @@
; Comments
(comment) @comment @spell
; Errors
(ERROR) @error

View file

@ -48,7 +48,3 @@
;; Comment
(comment) @comment @spell
;; Error
(ERROR) @error

View file

@ -18,5 +18,3 @@
(float) @float
(boolean) @boolean
(null) @keyword
(ERROR) @error

View file

@ -44,7 +44,3 @@
; Comments
(comment) @comment @spell
; Errors
(ERROR) @error

View file

@ -87,5 +87,3 @@
"("
"}"
] @punctuation.bracket
(ERROR) @error

View file

@ -158,7 +158,3 @@
; Comments
(comment) @comment @spell
; Errors
(ERROR) @error

View file

@ -268,6 +268,3 @@
] @exception
["do" "while" "continue" "for"] @repeat
; Error
(ERROR) @error

View file

@ -51,5 +51,3 @@
(preproc) @preproc
(comment) @spell
(ERROR) @error

View file

@ -117,5 +117,3 @@
[ "INCLUDE" "IGNORE" ] @include
(Comment) @comment @spell
(ERROR) @error

View file

@ -10,6 +10,3 @@
; EEx comments are highlighted as such
(comment) @comment @spell
; Tree-sitter parser errors
(ERROR) @error

View file

@ -19,9 +19,6 @@
"%"
] @punctuation.special
; Parser Errors
(ERROR) @error
; Identifiers
(identifier) @variable

View file

@ -184,6 +184,3 @@
(comment) @comment @spell
["=>" "<=" "="] @operator
; Error
(ERROR) @error

View file

@ -161,8 +161,3 @@
((program . (comment) @preproc)
(#lua-match? @preproc "^#!/"))
;; Error
(ERROR) @error

View file

@ -17,5 +17,3 @@
] @punctuation.delimiter
(comment) @comment @spell
(ERROR) @error

View file

@ -326,7 +326,3 @@
((comment) @comment.documentation
(#lua-match? @comment.documentation "^!>"))
; Errors
(ERROR) @error

View file

@ -1,5 +1,4 @@
;; Basic
(ERROR) @error
(identifier) @variable
(name) @variable

View file

@ -48,6 +48,4 @@
(trailing_slash)
] @error
(ERROR) @error
(comment) @comment @spell

View file

@ -29,5 +29,3 @@
(breaking_change (value) @text @spell)
(scissor) @comment
(ERROR) @error

View file

@ -167,6 +167,3 @@
; Pipe Operator
(binary_expression operator: "|>" right: (identifier) @function)
; Parser Errors
(ERROR) @error

View file

@ -245,10 +245,6 @@
(comment)+ @comment.documentation
. (var_declaration))
; Errors
(ERROR) @error
; Spell
((interpreted_string_literal) @spell

View file

@ -24,5 +24,3 @@
] @punctuation.bracket
"=" @operator
(ERROR) @error

View file

@ -45,5 +45,3 @@
[ "\"" "'" "," ] @punctuation.delimiter
(comment) @comment @spell
(ERROR) @error

View file

@ -28,5 +28,3 @@
type: (_) @type)
(bin
type: (_) @type)
(ERROR) @error

View file

@ -313,5 +313,3 @@
(xhp_open)
(xhp_close)
] @tag
(ERROR) @error

View file

@ -249,7 +249,3 @@
; Comments
(comment) @comment @spell
; Errors
(ERROR) @error

View file

@ -95,5 +95,3 @@
;
; first element in get_attr is a variable.builtin or a reference to a variable.builtin
(expression (variable_expr (identifier) @variable.builtin) (get_attr (identifier) @field))
(ERROR) @error

View file

@ -32,9 +32,6 @@
; HEEx text content is treated as markup
(text) @text
; Tree-sitter parser errors
(ERROR) @error
; HEEx tags and slots are highlighted as HTML
[
(tag_name)

View file

@ -6,7 +6,6 @@
(pair value: (string) @string)
(array (string) @string)
; (string_content (escape_sequence) @string.escape)
(ERROR) @error
; "," @punctuation.delimiter
"[" @punctuation.bracket
"]" @punctuation.bracket

View file

@ -54,7 +54,3 @@
; Comments
(comment) @comment @spell
; Errors
(ERROR) @error

View file

@ -12,8 +12,6 @@
(array (string) @string)
(ERROR) @error
["," ":"] @punctuation.delimiter
[

View file

@ -13,5 +13,3 @@
(member
name: (_) @keyword)
(ERROR) @error

View file

@ -116,6 +116,3 @@
(id) @parameter
))?
")")
; ERROR
(ERROR) @error

View file

@ -77,5 +77,3 @@
(source (prompt) @text.uri @string.special)
(comment) @comment @spell
(ERROR) @error

View file

@ -1,5 +1,4 @@
;; General syntax
(ERROR) @error
(command_name) @function
(caption

View file

@ -162,5 +162,3 @@
"none"
"zeroinitializer"
] @constant.builtin
(ERROR) @error

View file

@ -247,6 +247,3 @@
(string) @string
(escape_sequence) @string.escape
;; Error
(ERROR) @error

View file

@ -246,7 +246,3 @@
((comment) @comment.documentation
(#lua-match? @comment.documentation "^[-][-](%s?)@"))
; Errors
(ERROR) @error

View file

@ -148,7 +148,3 @@
; Comments
[ (comment) (line_continuation) ] @comment @spell
; Errors
(ERROR) @error

View file

@ -26,4 +26,3 @@
(ocaml) @none
[(comment) (line_comment) (ocaml_comment)] @comment @spell
(ERROR) @error

View file

@ -173,5 +173,3 @@
;---------
[(comment) (line_number_directive) (directive) (shebang)] @comment @spell
(ERROR) @error

View file

@ -38,4 +38,3 @@
; Misc
(comment) @comment @spell
(ERROR) @error

View file

@ -287,7 +287,3 @@
(comment)
(block_comment)
] @comment @spell
; Errors
(ERROR) @error

View file

@ -7,5 +7,3 @@
(data) @none
(comment) @comment @spell
(ERROR) @error

View file

@ -103,8 +103,6 @@
(function) @function
(ERROR) @error
(_
"{" @punctuation.special
(varname)

View file

@ -319,5 +319,3 @@
"@"
"::"
] @operator
(ERROR) @error

View file

@ -27,7 +27,3 @@
(comment (reference (text) @string.special.path))
(comment (flag (text) @preproc))
; Errors
(ERROR) @error

View file

@ -286,7 +286,3 @@
(line_comment)
(block_comment)
] @comment @spell
; Errors
(ERROR) @error

View file

@ -38,5 +38,3 @@
(function_name) @function.call
(comment) @comment @spell
(ERROR) @error

View file

@ -189,7 +189,3 @@
; Comments
(comment) @comment @spell
; Errors
(ERROR) @error

View file

@ -17,6 +17,4 @@
(escaped_char) @string.escape
(ERROR) @error
(comment) @comment @spell

View file

@ -346,6 +346,3 @@
;; https://docs.python.org/3/library/stdtypes.html
"bool" "int" "float" "complex" "list" "tuple" "range" "str"
"bytes" "bytearray" "memoryview" "set" "frozenset" "dict" "type" "object"))
;; Error
(ERROR) @error

View file

@ -139,6 +139,3 @@
(call
function: ((dollar _ (identifier) @method.call)))
; Error
(ERROR) @error

View file

@ -6,8 +6,6 @@
;; Basic highlights ;;
;;------------------------------------------------------------------;;
(ERROR) @error
;; basic ;;
(number) @number

View file

@ -78,5 +78,3 @@
(environ_value "env" @function.builtin (identifier) @variable)
(property_name) @variable
(ERROR) @error

View file

@ -186,5 +186,3 @@
(comment)
(ignore_block)
] @comment @spell
(ERROR) @error

View file

@ -42,6 +42,4 @@
(linebreak) @character.special
(ERROR) @error
(comment) @comment @spell

View file

@ -1,2 +0,0 @@
;; General syntax
;(ERROR) @error

View file

@ -50,4 +50,3 @@
;------------
(escape_sequence) @string.escape
(ERROR) @error

View file

@ -167,5 +167,3 @@
(#not-any-of? @_directive "code" "code-block" "sourcecode")))
(paragraph) @spell
(ERROR) @error

View file

@ -255,5 +255,3 @@
(interpolation
"#{" @punctuation.special
"}" @punctuation.special) @none
(ERROR) @error

View file

@ -212,7 +212,3 @@
(class_definition
(comment) @comment.documentation)
; Errors
(ERROR) @error

View file

@ -258,7 +258,3 @@
((comment) @comment.documentation
(#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$"))
; Errors
(ERROR) @error

View file

@ -68,8 +68,6 @@
(comment) @comment @spell
(ERROR) @error
; Punctuation
[ "${" "}" ] @punctuation.special

View file

@ -262,9 +262,6 @@
["," "." ":" ";" (ellipsis)] @punctuation.delimiter
;; Error
(ERROR) @error
;; Starlark-specific
;; Assertion calls

View file

@ -50,5 +50,3 @@
] @punctuation.delimiter
(comment) @comment @spell
(ERROR) @error

View file

@ -150,7 +150,3 @@
((comment) @preproc
(#lua-match? @preproc "^.*RUN"))
; Errors
(ERROR) @error

View file

@ -130,6 +130,3 @@
; (string (format_specifier) @string.escape)
; key: (identifier) @func-name)
; (#eq? @func-name "format"))
(ERROR) @error

View file

@ -224,7 +224,3 @@
((comment) @preproc
(#lua-match? @preproc "#!.*"))
; Errors
(ERROR) @error

View file

@ -32,5 +32,3 @@
"]]" @punctuation.bracket
"{" @punctuation.bracket
"}" @punctuation.bracket
(ERROR) @error

View file

@ -26,5 +26,3 @@
"("
")"
] @punctuation.bracket
(ERROR) @error

View file

@ -461,7 +461,3 @@
(_
(comment)+ @comment.documentation
[(function_declaration) (type_declaration) (enum_declaration)])
; Errors
(ERROR) @error

View file

@ -311,5 +311,3 @@
"("
")"
] @punctuation.bracket
(ERROR) @error

View file

@ -102,5 +102,3 @@
(identifier) @attribute)
[(line_comment) (block_comment)] @comment @spell
(ERROR) @error

View file

@ -11,7 +11,6 @@
(anchor_name) @type
(alias_name) @type
(tag) @type
(ERROR) @error
[
(yaml_directive)

View file

@ -144,7 +144,3 @@
; Comments
(comment) @comment @spell
; Errors
(ERROR) @error

View file

@ -227,6 +227,3 @@ field_constant: (IDENTIFIER) @constant
(PtrPayload "|")
(PtrIndexPayload "|")
] @punctuation.bracket
; Error
(ERROR) @error