mirror of
https://github.com/helix-editor/helix.git
synced 2024-08-17 06:40:47 +03:00
add initial support for bitbake language (#10010)
Signed-off-by: Pascal Eberhard <pascal.eberhard@se.com>
This commit is contained in:
parent
f5991657f4
commit
9a80f7203d
@ -9,6 +9,7 @@
|
||||
| beancount | ✓ | | | |
|
||||
| bibtex | ✓ | | | `texlab` |
|
||||
| bicep | ✓ | | | `bicep-langserver` |
|
||||
| bitbake | ✓ | | | `bitbake-language-server` |
|
||||
| blade | ✓ | | | |
|
||||
| blueprint | ✓ | | | `blueprint-compiler` |
|
||||
| c | ✓ | ✓ | ✓ | `clangd` |
|
||||
|
@ -12,6 +12,7 @@ awk-language-server = { command = "awk-language-server" }
|
||||
bash-language-server = { command = "bash-language-server", args = ["start"] }
|
||||
bass = { command = "bass", args = ["--lsp"] }
|
||||
bicep-langserver = { command = "bicep-langserver" }
|
||||
bitbake-language-server = { command = "bitbake-language-server" }
|
||||
bufls = { command = "bufls", args = ["serve"] }
|
||||
cairo-language-server = { command = "cairo-language-server", args = [] }
|
||||
cl-lsp = { command = "cl-lsp", args = [ "stdio" ] }
|
||||
@ -3209,6 +3210,17 @@ indent = { tab-width = 2, unit = " " }
|
||||
name = "dbml"
|
||||
source = { git = "https://github.com/dynamotn/tree-sitter-dbml", rev = "2e2fa5640268c33c3d3f27f7e676f631a9c68fd9" }
|
||||
|
||||
[[language]]
|
||||
name = "bitbake"
|
||||
language-servers = [ "bitbake-language-server" ]
|
||||
scope = "source.bitbake"
|
||||
file-types = ["bb", "bbappend", "bbclass", {glob = "conf/*.conf" }, {glob = "conf/*/*.{inc,conf}" }, { glob = "recipe-*/*/*.inc" }]
|
||||
comment-token = "#"
|
||||
|
||||
[[grammar]]
|
||||
name = "bitbake"
|
||||
source = { git = "https://github.com/tree-sitter-grammars/tree-sitter-bitbake", rev = "10bacac929ff36a1e8f4056503fe4f8717b21b94" }
|
||||
|
||||
[[language]]
|
||||
name = "log"
|
||||
scope = "source.log"
|
||||
|
82
runtime/queries/bitbake/highlights.scm
Normal file
82
runtime/queries/bitbake/highlights.scm
Normal file
@ -0,0 +1,82 @@
|
||||
|
||||
; variables
|
||||
(variable_assignment (identifier) @variable.other.member)
|
||||
(variable_assignment (concatenation (identifier) @variable.other.member))
|
||||
(unset_statement (identifier) @variable.other.member)
|
||||
(export_statement (identifier) @variable.other.member)
|
||||
(variable_expansion (identifier) @variable.other.member)
|
||||
(python_function_definition (parameters (python_identifier) @variable.other.member))
|
||||
|
||||
(variable_assignment (override) @keyword.storage.modifier)
|
||||
(overrides_statement (identifier) @keyword.storage.modifier)
|
||||
(flag) @keyword.storage.modifier
|
||||
|
||||
[
|
||||
"="
|
||||
"?="
|
||||
"??="
|
||||
":="
|
||||
"=+"
|
||||
"+="
|
||||
".="
|
||||
"=."
|
||||
|
||||
] @operator
|
||||
|
||||
(variable_expansion [ "${" "}" ] @punctuation.special)
|
||||
[ "(" ")" "{" "}" "[" "]" ] @punctuation.bracket
|
||||
|
||||
[
|
||||
"noexec"
|
||||
"INHERIT"
|
||||
"OVERRIDES"
|
||||
"$BB_ENV_PASSTHROUGH"
|
||||
"$BB_ENV_PASSTHROUGH_ADDITIONS"
|
||||
] @variable.builtin
|
||||
|
||||
; functions
|
||||
|
||||
(python_function_definition (python_identifier) @function)
|
||||
(anonymous_python_function (identifier) @function)
|
||||
(function_definition (identifier) @function)
|
||||
(export_functions_statement (identifier) @function)
|
||||
(addtask_statement (identifier) @function)
|
||||
(deltask_statement (identifier) @function)
|
||||
(addhandler_statement (identifier) @function)
|
||||
(function_definition (override) @keyword.storage.modifier)
|
||||
|
||||
[
|
||||
"addtask"
|
||||
"deltask"
|
||||
"addhandler"
|
||||
"unset"
|
||||
"EXPORT_FUNCTIONS"
|
||||
"python"
|
||||
"def"
|
||||
] @keyword.function
|
||||
|
||||
[
|
||||
"append"
|
||||
"prepend"
|
||||
"remove"
|
||||
|
||||
"before"
|
||||
"after"
|
||||
] @keyword.operator
|
||||
|
||||
; imports
|
||||
|
||||
[
|
||||
"inherit"
|
||||
"include"
|
||||
"require"
|
||||
"export"
|
||||
"import"
|
||||
] @keyword.control.import
|
||||
|
||||
(inherit_path) @namespace
|
||||
(include_path) @namespace
|
||||
|
||||
|
||||
(string) @string
|
||||
(comment) @comment
|
18
runtime/queries/bitbake/injections.scm
Normal file
18
runtime/queries/bitbake/injections.scm
Normal file
@ -0,0 +1,18 @@
|
||||
((python_function_definition) @injection.content
|
||||
(#set! injection.language "python")
|
||||
(#set! injection.include-children))
|
||||
|
||||
((anonymous_python_function (block) @injection.content)
|
||||
(#set! injection.language "python")
|
||||
(#set! injection.include-children))
|
||||
|
||||
((inline_python) @injection.content
|
||||
(#set! injection.language "python")
|
||||
(#set! injection.include-children))
|
||||
|
||||
((function_definition) @injection.content
|
||||
(#set! injection.language "bash")
|
||||
(#set! injection.include-children))
|
||||
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
Loading…
Reference in New Issue
Block a user