aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/queries/luadoc
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2023-06-12 09:54:30 -0600
committerChristian Clason <c.clason@uni-graz.at>2025-05-12 18:43:40 +0200
commit692b051b09935653befdb8f7ba8afdb640adf17b (patch)
tree167162b6b129ae04f68c5735078521a72917c742 /runtime/queries/luadoc
parentfeat(c-family): inherit injections (diff)
downloadnvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.gz
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.bz2
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.lz
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.xz
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.zst
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.zip
feat!: drop modules, general refactor and cleanup
Diffstat (limited to 'runtime/queries/luadoc')
-rw-r--r--runtime/queries/luadoc/highlights.scm198
1 files changed, 198 insertions, 0 deletions
diff --git a/runtime/queries/luadoc/highlights.scm b/runtime/queries/luadoc/highlights.scm
new file mode 100644
index 000000000..1649e5d9b
--- /dev/null
+++ b/runtime/queries/luadoc/highlights.scm
@@ -0,0 +1,198 @@
+; Keywords
+[
+ "@module"
+ "@package"
+] @keyword.import @nospell
+
+[
+ "@class"
+ "@type"
+ "@param"
+ "@alias"
+ "@field"
+ "@generic"
+ "@vararg"
+ "@diagnostic"
+ "@cast"
+ "@deprecated"
+ "@meta"
+ "@source"
+ "@version"
+ "@operator"
+ "@nodiscard"
+ "@cast"
+ "@overload"
+ "@enum"
+ "@language"
+ "@see"
+ "@as"
+ "extends"
+ (diagnostic_identifier)
+] @keyword @nospell
+
+"@async" @keyword.coroutine @nospell
+
+(language_injection
+ "@language"
+ (identifier) @keyword @nospell)
+
+(function_type
+ [
+ "fun"
+ "function"
+ ] @keyword.function @nospell)
+
+(source_annotation
+ filename: (identifier) @string.special.path @nospell
+ extension: (identifier) @string.special.path @nospell)
+
+(version_annotation
+ version: _ @constant.builtin @nospell)
+
+"@return" @keyword.return @nospell
+
+; Qualifiers
+[
+ "public"
+ "protected"
+ "private"
+ "package"
+ "@public"
+ "@protected"
+ "@private"
+ "(exact)"
+ "(key)"
+] @keyword.modifier @nospell
+
+; Variables
+(identifier) @variable @nospell
+
+[
+ "..."
+ "self"
+] @variable.builtin @nospell
+
+; Macros
+(alias_annotation
+ (identifier) @function.macro @nospell)
+
+; Parameters
+(param_annotation
+ (identifier) @variable.parameter @nospell)
+
+(parameter
+ (identifier) @variable.parameter @nospell)
+
+; Fields
+(field_annotation
+ (identifier) @variable.member @nospell)
+
+(table_literal_type
+ field: (identifier) @variable.member @nospell)
+
+(member_type
+ [
+ "#"
+ "."
+ ]
+ .
+ (identifier) @variable.member @nospell)
+
+(member_type
+ (identifier) @module @nospell)
+
+(member_type
+ (identifier) @type @nospell .)
+
+; Types
+(table_type
+ "table" @type.builtin @nospell)
+
+(builtin_type) @type.builtin @nospell
+
+(class_annotation
+ (identifier) @type @nospell)
+
+(enum_annotation
+ (identifier) @type @nospell)
+
+((array_type
+ [
+ "["
+ "]"
+ ] @type)
+ (#set! priority 105))
+
+(type) @type
+
+; Operators
+[
+ "|"
+ "+"
+ "-"
+] @operator
+
+; Literals
+[
+ (string)
+ (literal_type)
+ "`"
+] @string
+
+(module_annotation
+ (string) @module @nospell)
+
+[
+ (number)
+ (numeric_literal_type)
+] @number
+
+; Punctuation
+[
+ "["
+ "]"
+ "[["
+ "]]"
+ "[=["
+ "]=]"
+] @punctuation.bracket
+
+[
+ "{"
+ "}"
+] @punctuation.bracket
+
+[
+ "("
+ ")"
+] @punctuation.bracket
+
+[
+ "<"
+ ">"
+] @punctuation.bracket
+
+[
+ ","
+ "."
+ "#"
+ ":"
+] @punctuation.delimiter
+
+[
+ "@"
+ "?"
+] @punctuation.special
+
+; Comments
+(comment) @comment @spell
+
+(at_comment
+ (identifier) @type @nospell
+ (_) @comment @spell)
+
+(class_at_comment
+ (identifier) @type @nospell
+ ("extends"?
+ (identifier)? @type @nospell)
+ (_) @comment @spell)