aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/queries/inko/highlights.scm
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/inko/highlights.scm
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/inko/highlights.scm')
-rw-r--r--runtime/queries/inko/highlights.scm203
1 files changed, 203 insertions, 0 deletions
diff --git a/runtime/queries/inko/highlights.scm b/runtime/queries/inko/highlights.scm
new file mode 100644
index 000000000..989bdb9e8
--- /dev/null
+++ b/runtime/queries/inko/highlights.scm
@@ -0,0 +1,203 @@
+; Brackets and operators
+[
+ "("
+ ")"
+ "["
+ "]"
+ "{"
+ "}"
+] @punctuation.bracket
+
+[
+ ","
+ "->"
+ "."
+ ":"
+] @punctuation.delimiter
+
+[
+ "!="
+ "%"
+ "%="
+ "&"
+ "&="
+ "*"
+ "**"
+ "**="
+ "*="
+ "+"
+ "+="
+ "-"
+ "-="
+ "/"
+ "/="
+ "<"
+ "<<"
+ "<<="
+ "<="
+ "<="
+ "=="
+ ">"
+ ">="
+ ">="
+ ">>"
+ ">>="
+ ">>>"
+ ">>>="
+ "^"
+ "^="
+ "|"
+ "|="
+] @operator
+
+; Keywords
+[
+ "as"
+ "copy"
+ "for"
+ "impl"
+ "in"
+ "inline"
+ "let"
+ "move"
+ "mut"
+ "recover"
+ "ref"
+ "uni"
+] @keyword
+
+"fn" @keyword.function
+
+"import" @keyword.import
+
+[
+ "and"
+ "or"
+] @keyword.operator
+
+[
+ "trait"
+ "type"
+] @keyword.type
+
+[
+ "extern"
+ (modifier)
+ (visibility)
+] @keyword.modifier
+
+[
+ "loop"
+ "while"
+ (break)
+ (next)
+] @keyword.repeat
+
+"return" @keyword.return
+
+[
+ "throw"
+ "try"
+] @keyword.exception
+
+[
+ "case"
+ "else"
+ "if"
+ "match"
+] @keyword.conditional
+
+; Identifiers/variable references
+(identifier) @variable
+
+; Comments
+(line_comment) @comment @spell
+
+; Literals
+(self) @variable.builtin
+
+(nil) @constant.builtin
+
+[
+ (true)
+ (false)
+] @boolean
+
+(integer) @number
+
+(float) @number.float
+
+(string) @string
+
+(escape_sequence) @string.escape
+
+(interpolation
+ "${" @punctuation.special
+ "}" @punctuation.special) @none
+
+(constant) @constant
+
+; Patterns
+(integer_pattern) @number
+
+(string_pattern) @string
+
+(constant_pattern) @constant
+
+(boolean_pattern) @boolean
+
+; Types
+(generic_type
+ name: _ @type)
+
+(type) @type
+
+; Imports
+(extern_import
+ path: _ @string)
+
+(import
+ (path
+ (identifier) @module))
+
+; Classes
+(class
+ name: _ @type)
+
+(define_field
+ name: _ @variable.member)
+
+; Traits
+(trait
+ name: _ @type)
+
+; Implementations
+(implement_trait
+ class: _ @type)
+
+(reopen_class
+ name: _ @type)
+
+(bound
+ name: _ @type)
+
+; Methods
+(method
+ name: _ @function)
+
+(external_function
+ name: _ @function)
+
+(argument
+ name: _ @variable.parameter)
+
+(named_argument
+ name: _ @variable.parameter)
+
+(call
+ name: [
+ (name)
+ (constant)
+ ] @function)
+
+(field) @variable.member