mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-15 01:40:02 -04:00
feat: add idl
This commit is contained in:
parent
0883ff0565
commit
37ac5f1f9f
4 changed files with 224 additions and 0 deletions
|
|
@ -314,6 +314,9 @@
|
||||||
"hyprlang": {
|
"hyprlang": {
|
||||||
"revision": "e5da7d0aa44403153e0394d87d9edea4e5bd6609"
|
"revision": "e5da7d0aa44403153e0394d87d9edea4e5bd6609"
|
||||||
},
|
},
|
||||||
|
"idl": {
|
||||||
|
"revision": "ea10c7b6c45d0a53e37afc54a825efe92d0b8f1e"
|
||||||
|
},
|
||||||
"ini": {
|
"ini": {
|
||||||
"revision": "bcb84a2d4bcd6f55b911c42deade75c8f90cb0c5"
|
"revision": "bcb84a2d4bcd6f55b911c42deade75c8f90cb0c5"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -949,6 +949,14 @@ list.hyprlang = {
|
||||||
maintainers = { "@luckasRanarison" },
|
maintainers = { "@luckasRanarison" },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
list.idl = {
|
||||||
|
install_info = {
|
||||||
|
url = "https://github.com/cathaysia/tree-sitter-idl",
|
||||||
|
files = { "src/parser.c" },
|
||||||
|
},
|
||||||
|
maintainers = { "@cathaysa" },
|
||||||
|
}
|
||||||
|
|
||||||
list.ini = {
|
list.ini = {
|
||||||
install_info = {
|
install_info = {
|
||||||
url = "https://github.com/justinmk/tree-sitter-ini",
|
url = "https://github.com/justinmk/tree-sitter-ini",
|
||||||
|
|
|
||||||
205
queries/idl/highlights.scm
Normal file
205
queries/idl/highlights.scm
Normal file
|
|
@ -0,0 +1,205 @@
|
||||||
|
; https://neovim.io/doc/user/treesitter.html#treesitter-highlight-groups
|
||||||
|
(comment) @comment @spell
|
||||||
|
|
||||||
|
[
|
||||||
|
"enum"
|
||||||
|
"struct"
|
||||||
|
"union"
|
||||||
|
"bitmask"
|
||||||
|
"bitset"
|
||||||
|
"@annotation"
|
||||||
|
"interface"
|
||||||
|
"exception"
|
||||||
|
"typedef"
|
||||||
|
] @keyword.type
|
||||||
|
|
||||||
|
[
|
||||||
|
"module"
|
||||||
|
"attribute"
|
||||||
|
] @keyword
|
||||||
|
|
||||||
|
[
|
||||||
|
"const"
|
||||||
|
"readonly"
|
||||||
|
] @keyword.modifier
|
||||||
|
|
||||||
|
[
|
||||||
|
"switch"
|
||||||
|
"case"
|
||||||
|
"default"
|
||||||
|
] @keyword.conditional
|
||||||
|
|
||||||
|
[
|
||||||
|
"void"
|
||||||
|
(signed_short_int)
|
||||||
|
(signed_long_int)
|
||||||
|
(signed_longlong_int)
|
||||||
|
(unsigned_tiny_int)
|
||||||
|
(boolean_type)
|
||||||
|
(fixed_pt_const_type)
|
||||||
|
(octet_type)
|
||||||
|
(signed_tiny_int)
|
||||||
|
(unsigned_short_int)
|
||||||
|
(unsigned_long_int)
|
||||||
|
(unsigned_longlong_int)
|
||||||
|
(floating_pt_type)
|
||||||
|
(char_type)
|
||||||
|
(scoped_name)
|
||||||
|
(string_type)
|
||||||
|
(any_type)
|
||||||
|
(fixed_pt_type)
|
||||||
|
(sequence_type)
|
||||||
|
(map_type)
|
||||||
|
] @type.builtin
|
||||||
|
|
||||||
|
(boolean_literal) @boolean
|
||||||
|
|
||||||
|
(number_literal) @number
|
||||||
|
|
||||||
|
(char_literal) @character
|
||||||
|
|
||||||
|
(string_literal) @string
|
||||||
|
|
||||||
|
[
|
||||||
|
"("
|
||||||
|
")"
|
||||||
|
"["
|
||||||
|
"]"
|
||||||
|
"<"
|
||||||
|
">"
|
||||||
|
"{"
|
||||||
|
"}"
|
||||||
|
] @punctuation.bracket
|
||||||
|
|
||||||
|
[
|
||||||
|
"-"
|
||||||
|
"*"
|
||||||
|
"+"
|
||||||
|
"="
|
||||||
|
"<<"
|
||||||
|
">>"
|
||||||
|
"%"
|
||||||
|
"~"
|
||||||
|
"|"
|
||||||
|
"^"
|
||||||
|
"$"
|
||||||
|
] @operator
|
||||||
|
|
||||||
|
[
|
||||||
|
"::"
|
||||||
|
";"
|
||||||
|
":"
|
||||||
|
","
|
||||||
|
] @punctuation.delimiter
|
||||||
|
|
||||||
|
(readonly_attr_declarator
|
||||||
|
(simple_declarator) @variable.member)
|
||||||
|
|
||||||
|
(attr_declarator) @variable.member
|
||||||
|
|
||||||
|
(annotation_appl
|
||||||
|
"@" @attribute
|
||||||
|
(scoped_name) @attribute)
|
||||||
|
|
||||||
|
(op_dcl
|
||||||
|
(identifier) @function.method)
|
||||||
|
|
||||||
|
(type_declarator
|
||||||
|
(simple_type_spec) @type
|
||||||
|
(any_declarators) @type)
|
||||||
|
|
||||||
|
(param_dcl
|
||||||
|
(simple_declarator) @variable.parameter)
|
||||||
|
|
||||||
|
(raises_expr
|
||||||
|
"raises" @keyword.exception
|
||||||
|
(scoped_name
|
||||||
|
(identifier) @type))
|
||||||
|
|
||||||
|
(param_dcl
|
||||||
|
(param_attribute) @keyword.modifier)
|
||||||
|
|
||||||
|
(preproc_call
|
||||||
|
directive: (preproc_directive) @keyword.directive
|
||||||
|
argument: (_) @constant)
|
||||||
|
|
||||||
|
(module_dcl
|
||||||
|
(identifier) @module)
|
||||||
|
|
||||||
|
(struct_def
|
||||||
|
(identifier) @type
|
||||||
|
parent: (scoped_name)? @type)
|
||||||
|
|
||||||
|
(enum_dcl
|
||||||
|
(enumerator
|
||||||
|
(identifier) @constant))
|
||||||
|
|
||||||
|
(annotation_dcl
|
||||||
|
(identifier) @type)
|
||||||
|
|
||||||
|
(struct_forward_dcl
|
||||||
|
(identifier) @type)
|
||||||
|
|
||||||
|
(bitmask_dcl
|
||||||
|
(identifier) @type)
|
||||||
|
|
||||||
|
(bitset_dcl
|
||||||
|
(identifier) @type
|
||||||
|
(scoped_name)* @type)
|
||||||
|
|
||||||
|
(enum_dcl
|
||||||
|
(identifier) @type)
|
||||||
|
|
||||||
|
(union_forward_dcl
|
||||||
|
(identifier) @type)
|
||||||
|
|
||||||
|
(interface_forward_dcl
|
||||||
|
(identifier) @type)
|
||||||
|
|
||||||
|
(interface_header
|
||||||
|
(identifier) @type)
|
||||||
|
|
||||||
|
(interface_inheritance_spec
|
||||||
|
(interface_name) @type)
|
||||||
|
|
||||||
|
(union_def
|
||||||
|
(identifier) @type
|
||||||
|
(switch_type_spec) @type)
|
||||||
|
|
||||||
|
(except_dcl
|
||||||
|
(identifier) @type)
|
||||||
|
|
||||||
|
(annotation_member_type) @type
|
||||||
|
|
||||||
|
(bitfield
|
||||||
|
(bitfield_spec
|
||||||
|
"bitfield" @keyword.modifier
|
||||||
|
(positive_int_const) @number
|
||||||
|
(destination_type)* @type)
|
||||||
|
(identifier) @variable.parameter)
|
||||||
|
|
||||||
|
(bit_value) @constant
|
||||||
|
|
||||||
|
(annotation_member
|
||||||
|
(annotation_member_type) @type
|
||||||
|
(simple_declarator) @property)
|
||||||
|
|
||||||
|
(const_dcl
|
||||||
|
(const_type) @type
|
||||||
|
(identifier) @constant)
|
||||||
|
|
||||||
|
(case_label
|
||||||
|
(const_expr) @constant)
|
||||||
|
|
||||||
|
(simple_type_spec
|
||||||
|
(scoped_name
|
||||||
|
(identifier) @type))
|
||||||
|
|
||||||
|
(simple_declarator
|
||||||
|
(identifier) @attribute)
|
||||||
|
|
||||||
|
(array_declarator
|
||||||
|
(identifier) @attribute)
|
||||||
|
|
||||||
|
(annotation_appl_param
|
||||||
|
(identifier) @attribute)
|
||||||
8
queries/idl/injections.scm
Normal file
8
queries/idl/injections.scm
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
((comment) @injection.content
|
||||||
|
(#lua-match? @injection.content "/[*\/][!*\/]<?[^a-zA-Z]")
|
||||||
|
(#set! injection.language "doxygen"))
|
||||||
|
|
||||||
|
((comment) @injection.content
|
||||||
|
(#not-lua-match? @injection.content "/[*\/][!*\/]<?[^a-zA-Z]")
|
||||||
|
(#not-lua-match? @injection.content "//@[a-zA-Z]")
|
||||||
|
(#set! injection.language "comment"))
|
||||||
Loading…
Add table
Add a link
Reference in a new issue