nvim-treesitter/runtime/queries/luadoc/highlights.scm

198 lines
2.5 KiB
Scheme
Raw Permalink Normal View History

2023-03-19 08:09:12 -04:00
; Keywords
2023-03-24 08:07:45 -04:00
[
"@module"
"@package"
] @keyword.import @nospell
2023-03-24 08:07:45 -04:00
2023-03-19 08:09:12 -04:00
[
"@class"
"@type"
"@param"
"@alias"
"@field"
"@generic"
"@vararg"
"@diagnostic"
"@cast"
2023-03-19 08:09:12 -04:00
"@deprecated"
2023-03-24 08:07:45 -04:00
"@meta"
"@source"
"@version"
"@operator"
"@nodiscard"
2023-03-19 08:09:12 -04:00
"@overload"
"@enum"
"@language"
"@see"
"@as"
2023-03-19 08:09:12 -04:00
"extends"
(diagnostic_identifier)
] @keyword @nospell
2023-03-19 08:09:12 -04:00
"@async" @keyword.coroutine @nospell
2023-03-19 08:09:12 -04:00
2024-01-06 15:05:50 +09:00
(language_injection
"@language"
(identifier) @keyword @nospell)
2023-03-19 08:09:12 -04:00
2024-01-06 15:05:50 +09:00
(function_type
[
"fun"
"function"
] @keyword.function @nospell)
2023-03-19 08:09:12 -04:00
2023-03-24 08:07:45 -04:00
(source_annotation
filename: (identifier) @string.special.path @nospell
extension: (identifier) @string.special.path @nospell)
2023-03-24 08:07:45 -04:00
(version_annotation
version: _ @constant.builtin @nospell)
2023-03-24 08:07:45 -04:00
"@return" @keyword.return @nospell
2023-03-19 08:09:12 -04:00
; Qualifiers
[
"public"
"protected"
"private"
"package"
2023-03-19 08:09:12 -04:00
"@public"
"@protected"
"@private"
"(exact)"
"(key)"
] @keyword.modifier @nospell
2023-03-19 08:09:12 -04:00
; Variables
(identifier) @variable @nospell
2023-03-19 08:09:12 -04:00
[
"..."
"self"
] @variable.builtin @nospell
2023-03-19 08:09:12 -04:00
; Macros
2024-01-06 15:05:50 +09:00
(alias_annotation
(identifier) @function.macro @nospell)
2023-03-19 08:09:12 -04:00
; Parameters
2024-01-06 15:05:50 +09:00
(param_annotation
(identifier) @variable.parameter @nospell)
2023-03-19 08:09:12 -04:00
2024-01-06 15:05:50 +09:00
(parameter
(identifier) @variable.parameter @nospell)
2023-03-19 08:09:12 -04:00
; Fields
2024-01-06 15:05:50 +09:00
(field_annotation
(identifier) @variable.member @nospell)
2023-03-19 08:09:12 -04:00
2024-01-06 15:05:50 +09:00
(table_literal_type
field: (identifier) @variable.member @nospell)
2023-03-19 08:09:12 -04:00
2024-01-06 15:05:50 +09:00
(member_type
[
"#"
"."
]
.
(identifier) @variable.member @nospell)
2023-03-19 08:09:12 -04:00
(member_type
(identifier) @module @nospell)
(member_type
(identifier) @type @nospell .)
2023-03-19 08:09:12 -04:00
; Types
2024-01-06 15:05:50 +09:00
(table_type
"table" @type.builtin @nospell)
2023-03-19 08:09:12 -04:00
(builtin_type) @type.builtin @nospell
2023-03-19 08:09:12 -04:00
2024-01-06 15:05:50 +09:00
(class_annotation
(identifier) @type @nospell)
2023-03-19 08:09:12 -04:00
2024-01-06 15:05:50 +09:00
(enum_annotation
(identifier) @type @nospell)
2023-03-19 08:09:12 -04:00
2024-01-06 15:05:50 +09:00
((array_type
[
"["
"]"
] @type)
(#set! priority 105))
2023-03-19 08:09:12 -04:00
(type) @type
; Operators
[
"|"
"+"
"-"
] @operator
2023-03-19 08:09:12 -04:00
; Literals
[
(string)
(literal_type)
"`"
] @string
2023-03-24 08:07:45 -04:00
(module_annotation
(string) @module @nospell)
2023-03-19 08:09:12 -04:00
[
(number)
(numeric_literal_type)
] @number
2023-03-19 08:09:12 -04:00
; Punctuation
2024-01-06 15:05:50 +09:00
[
"["
"]"
"[["
"]]"
"[=["
"]=]"
2024-01-06 15:05:50 +09:00
] @punctuation.bracket
2023-03-19 08:09:12 -04:00
2024-01-06 15:05:50 +09:00
[
"{"
"}"
] @punctuation.bracket
2023-03-19 08:09:12 -04:00
2024-01-06 15:05:50 +09:00
[
"("
")"
] @punctuation.bracket
2023-03-19 08:09:12 -04:00
2024-01-06 15:05:50 +09:00
[
"<"
">"
] @punctuation.bracket
2023-03-19 08:09:12 -04:00
[
","
"."
"#"
":"
] @punctuation.delimiter
[
"@"
"?"
] @punctuation.special
; Comments
(comment) @comment @spell
2023-03-24 08:07:45 -04:00
(at_comment
(identifier) @type @nospell
2023-03-19 08:09:12 -04:00
(_) @comment @spell)
2023-03-24 08:07:45 -04:00
(class_at_comment
(identifier) @type @nospell
2024-01-06 15:05:50 +09:00
("extends"?
(identifier)? @type @nospell)
2023-03-19 08:09:12 -04:00
(_) @comment @spell)