mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-09-11 16:07:00 +03:00
Change Odin grammar to ap29600/tree-sitter-odin
(#6766)
* Change Odin grammar to `ap29600/tree-sitter-odin` The previously adopted grammar, `MineBill/tree-sitter-odin`, is unmaintained and mentions my repository as an alternative source. * update queries * docgen * fix queries * Update runtime/queries/odin/highlights.scm Co-authored-by: Michael Davis <mcarsondavis@gmail.com> * remove `ERROR` query for `odin` * track the latest rev in `ap29600/tree-sitter-odin` * runtime/queries/odin/highlights.scm: update rune highlight class Co-authored-by: Michael Davis <mcarsondavis@gmail.com> --------- Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
This commit is contained in:
parent
2836ea2ac4
commit
9cdc6b2e8a
@ -98,7 +98,7 @@
|
|||||||
| nu | ✓ | | | |
|
| nu | ✓ | | | |
|
||||||
| ocaml | ✓ | | ✓ | `ocamllsp` |
|
| ocaml | ✓ | | ✓ | `ocamllsp` |
|
||||||
| ocaml-interface | ✓ | | | `ocamllsp` |
|
| ocaml-interface | ✓ | | | `ocamllsp` |
|
||||||
| odin | ✓ | | | `ols` |
|
| odin | ✓ | | ✓ | `ols` |
|
||||||
| opencl | ✓ | ✓ | ✓ | `clangd` |
|
| opencl | ✓ | ✓ | ✓ | `clangd` |
|
||||||
| openscad | ✓ | | | `openscad-lsp` |
|
| openscad | ✓ | | | `openscad-lsp` |
|
||||||
| org | ✓ | | | |
|
| org | ✓ | | | |
|
||||||
|
@ -1675,7 +1675,7 @@ indent = { tab-width = 4, unit = "\t" }
|
|||||||
|
|
||||||
[[grammar]]
|
[[grammar]]
|
||||||
name = "odin"
|
name = "odin"
|
||||||
source = { git = "https://github.com/MineBill/tree-sitter-odin", rev = "da885f4a387f169b9b69fe0968259ee257a8f69a" }
|
source = { git = "https://github.com/ap29600/tree-sitter-odin", rev = "b219207e49ffca2952529d33e94ed63b1b75c4f1" }
|
||||||
|
|
||||||
[[language]]
|
[[language]]
|
||||||
name = "meson"
|
name = "meson"
|
||||||
|
@ -1,141 +1,26 @@
|
|||||||
; Function calls
|
(keyword) @keyword
|
||||||
|
(operator) @operator
|
||||||
|
|
||||||
(call_expression
|
(int_literal) @constant.numeric.integer
|
||||||
function: (identifier) @function)
|
(float_literal) @constant.numeric.float
|
||||||
|
(rune_literal) @constant.character
|
||||||
|
(bool_literal) @constant.builtin.boolean
|
||||||
|
(nil) @constant.builtin
|
||||||
|
|
||||||
(call_expression
|
(type_identifier) @type
|
||||||
function: (selector_expression
|
(package_identifier) @namespace
|
||||||
field: (field_identifier) @function))
|
(label_identifier) @label
|
||||||
|
|
||||||
|
|
||||||
; ; Function definitions
|
|
||||||
|
|
||||||
(function_declaration
|
|
||||||
name: (identifier) @function)
|
|
||||||
|
|
||||||
(proc_group
|
|
||||||
(identifier) @function)
|
|
||||||
|
|
||||||
; ; Identifiers
|
|
||||||
|
|
||||||
(type_identifier) @type
|
|
||||||
(field_identifier) @variable.other.member
|
|
||||||
(identifier) @variable
|
|
||||||
|
|
||||||
(const_declaration
|
|
||||||
(identifier) @constant)
|
|
||||||
(const_declaration_with_type
|
|
||||||
(identifier) @constant)
|
|
||||||
|
|
||||||
"any" @type
|
|
||||||
|
|
||||||
(directive_identifier) @constant
|
|
||||||
|
|
||||||
; ; Operators
|
|
||||||
|
|
||||||
[
|
|
||||||
"?"
|
|
||||||
"-"
|
|
||||||
"-="
|
|
||||||
":="
|
|
||||||
"!"
|
|
||||||
"!="
|
|
||||||
"*"
|
|
||||||
"*"
|
|
||||||
"*="
|
|
||||||
"/"
|
|
||||||
"/="
|
|
||||||
"&"
|
|
||||||
"&&"
|
|
||||||
"&="
|
|
||||||
"%"
|
|
||||||
"%="
|
|
||||||
"^"
|
|
||||||
"+"
|
|
||||||
"+="
|
|
||||||
"<-"
|
|
||||||
"<"
|
|
||||||
"<<"
|
|
||||||
"<<="
|
|
||||||
"<="
|
|
||||||
"="
|
|
||||||
"=="
|
|
||||||
">"
|
|
||||||
">="
|
|
||||||
">>"
|
|
||||||
">>="
|
|
||||||
"|"
|
|
||||||
"|="
|
|
||||||
"||"
|
|
||||||
"~"
|
|
||||||
".."
|
|
||||||
"..<"
|
|
||||||
"..="
|
|
||||||
"::"
|
|
||||||
] @operator
|
|
||||||
|
|
||||||
; ; Keywords
|
|
||||||
|
|
||||||
[
|
|
||||||
; "asm"
|
|
||||||
"auto_cast"
|
|
||||||
; "bit_set"
|
|
||||||
"cast"
|
|
||||||
; "context"
|
|
||||||
; "or_else"
|
|
||||||
; "or_return"
|
|
||||||
"in"
|
|
||||||
; "not_in"
|
|
||||||
"distinct"
|
|
||||||
"foreign"
|
|
||||||
"transmute"
|
|
||||||
; "typeid"
|
|
||||||
|
|
||||||
"break"
|
|
||||||
"case"
|
|
||||||
"continue"
|
|
||||||
"defer"
|
|
||||||
"else"
|
|
||||||
"using"
|
|
||||||
"when"
|
|
||||||
"where"
|
|
||||||
"fallthrough"
|
|
||||||
"for"
|
|
||||||
"proc"
|
|
||||||
"if"
|
|
||||||
"import"
|
|
||||||
"map"
|
|
||||||
"package"
|
|
||||||
"return"
|
|
||||||
"struct"
|
|
||||||
"union"
|
|
||||||
"enum"
|
|
||||||
"switch"
|
|
||||||
"dynamic"
|
|
||||||
] @keyword
|
|
||||||
|
|
||||||
; ; Literals
|
|
||||||
|
|
||||||
[
|
|
||||||
(interpreted_string_literal)
|
|
||||||
(raw_string_literal)
|
|
||||||
(rune_literal)
|
|
||||||
] @string
|
|
||||||
|
|
||||||
|
(interpreted_string_literal) @string
|
||||||
|
(raw_string_literal) @string
|
||||||
(escape_sequence) @constant.character.escape
|
(escape_sequence) @constant.character.escape
|
||||||
|
|
||||||
(int_literal) @constant.numeric.integer
|
(comment) @comment
|
||||||
(float_literal) @constant.numeric.float
|
(const_identifier) @constant
|
||||||
(imaginary_literal) @constant.numeric
|
|
||||||
|
|
||||||
[
|
|
||||||
(true)
|
|
||||||
(false)
|
|
||||||
] @constant.builtin.boolean
|
|
||||||
|
|
||||||
[
|
(compiler_directive) @keyword.directive
|
||||||
(nil)
|
(calling_convention) @string.special.symbol
|
||||||
(undefined)
|
|
||||||
] @constant.builtin
|
|
||||||
|
|
||||||
(comment) @comment.line
|
(identifier) @variable
|
||||||
|
(pragma_identifier) @keyword.directive
|
||||||
|
16
runtime/queries/odin/indents.scm
Normal file
16
runtime/queries/odin/indents.scm
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
[
|
||||||
|
(foreign_block)
|
||||||
|
(block)
|
||||||
|
(compound_literal)
|
||||||
|
(proc_call)
|
||||||
|
(assignment_statement)
|
||||||
|
(const_declaration)
|
||||||
|
(var_declaration)
|
||||||
|
(switch_statement)
|
||||||
|
] @indent
|
||||||
|
|
||||||
|
[
|
||||||
|
")"
|
||||||
|
"}"
|
||||||
|
] @outdent
|
||||||
|
|
Loading…
Reference in New Issue
Block a user