mirror of https://github.com/helix-editor/helix
feat(languages): add odin language (#2399)
parent
2f240b018e
commit
495ba40eaf
|
@ -59,6 +59,7 @@
|
||||||
| nu | ✓ | | | |
|
| nu | ✓ | | | |
|
||||||
| ocaml | ✓ | | ✓ | `ocamllsp` |
|
| ocaml | ✓ | | ✓ | `ocamllsp` |
|
||||||
| ocaml-interface | ✓ | | | `ocamllsp` |
|
| ocaml-interface | ✓ | | | `ocamllsp` |
|
||||||
|
| odin | ✓ | | | |
|
||||||
| org | ✓ | | | |
|
| org | ✓ | | | |
|
||||||
| perl | ✓ | ✓ | ✓ | |
|
| perl | ✓ | ✓ | ✓ | |
|
||||||
| php | ✓ | ✓ | ✓ | `intelephense` |
|
| php | ✓ | ✓ | ✓ | `intelephense` |
|
||||||
|
|
|
@ -1329,3 +1329,16 @@ indent = { tab-width = 2, unit = " " }
|
||||||
[[grammar]]
|
[[grammar]]
|
||||||
name = "cpon"
|
name = "cpon"
|
||||||
source = { git = "https://github.com/fvacek/tree-sitter-cpon", rev = "11ba46a4de3eb86934003133099c9963a60f9687" }
|
source = { git = "https://github.com/fvacek/tree-sitter-cpon", rev = "11ba46a4de3eb86934003133099c9963a60f9687" }
|
||||||
|
|
||||||
|
[[language]]
|
||||||
|
name = "odin"
|
||||||
|
auto-format = false
|
||||||
|
scope = "source.odin"
|
||||||
|
file-types = ["odin"]
|
||||||
|
roots = []
|
||||||
|
comment-token = "//"
|
||||||
|
indent = { tab-width = 4, unit = " " }
|
||||||
|
|
||||||
|
[[grammar]]
|
||||||
|
name = "odin"
|
||||||
|
source = { git = "https://github.com/MineBill/tree-sitter-odin", rev = "da885f4a387f169b9b69fe0968259ee257a8f69a" }
|
||||||
|
|
|
@ -0,0 +1,141 @@
|
||||||
|
; Function calls
|
||||||
|
|
||||||
|
(call_expression
|
||||||
|
function: (identifier) @function)
|
||||||
|
|
||||||
|
(call_expression
|
||||||
|
function: (selector_expression
|
||||||
|
field: (field_identifier) @function))
|
||||||
|
|
||||||
|
|
||||||
|
; ; 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
|
||||||
|
|
||||||
|
(escape_sequence) @constant.character.escape
|
||||||
|
|
||||||
|
(int_literal) @constant.numeric.integer
|
||||||
|
(float_literal) @constant.numeric.float
|
||||||
|
(imaginary_literal) @constant.numeric
|
||||||
|
|
||||||
|
[
|
||||||
|
(true)
|
||||||
|
(false)
|
||||||
|
] @constant.builtin.boolean
|
||||||
|
|
||||||
|
[
|
||||||
|
(nil)
|
||||||
|
(undefined)
|
||||||
|
] @constant.builtin
|
||||||
|
|
||||||
|
(comment) @comment.line
|
Loading…
Reference in New Issue