mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-25 19:03:30 +04:00
feat(lang): add devicetree (Flattened Device Tree Source) (#2329)
This commit is contained in:
parent
030e7ab988
commit
8e77e3388c
@ -8,6 +8,7 @@
|
|||||||
| cpp | ✓ | ✓ | ✓ | `clangd` |
|
| cpp | ✓ | ✓ | ✓ | `clangd` |
|
||||||
| css | ✓ | | | `vscode-css-language-server` |
|
| css | ✓ | | | `vscode-css-language-server` |
|
||||||
| dart | ✓ | | ✓ | `dart` |
|
| dart | ✓ | | ✓ | `dart` |
|
||||||
|
| devicetree | ✓ | | ✓ | |
|
||||||
| dockerfile | ✓ | | | `docker-langserver` |
|
| dockerfile | ✓ | | | `docker-langserver` |
|
||||||
| eex | ✓ | | | |
|
| eex | ✓ | | | |
|
||||||
| ejs | ✓ | | | |
|
| ejs | ✓ | | | |
|
||||||
|
@ -1263,3 +1263,16 @@ indent = { tab-width = 4, unit = "\t" }
|
|||||||
[[grammar]]
|
[[grammar]]
|
||||||
name = "hare"
|
name = "hare"
|
||||||
source = { git = "https://git.sr.ht/~ecmma/tree-sitter-hare", rev = "bc26a6a949f2e0d98b7bfc437d459b250900a165" }
|
source = { git = "https://git.sr.ht/~ecmma/tree-sitter-hare", rev = "bc26a6a949f2e0d98b7bfc437d459b250900a165" }
|
||||||
|
|
||||||
|
[[language]]
|
||||||
|
name = "devicetree"
|
||||||
|
scope = "source.devicetree"
|
||||||
|
injection-regex = "(dtsi?|devicetree|fdt)"
|
||||||
|
file-types = ["dts", "dtsi"]
|
||||||
|
roots = []
|
||||||
|
comment-token = "//"
|
||||||
|
indent = { tab-width = 4, unit = "\t" }
|
||||||
|
|
||||||
|
[[grammar]]
|
||||||
|
name = "devicetree"
|
||||||
|
source = { git = "https://github.com/joelspadin/tree-sitter-devicetree", rev = "877adbfa0174d25894c40fa75ad52d4515a36368" }
|
||||||
|
66
runtime/queries/devicetree/highlights.scm
Normal file
66
runtime/queries/devicetree/highlights.scm
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
[
|
||||||
|
"/dts-v1/"
|
||||||
|
"/memreserve/"
|
||||||
|
"/delete-node/"
|
||||||
|
"/delete-property/"
|
||||||
|
] @keyword
|
||||||
|
|
||||||
|
[
|
||||||
|
"#define"
|
||||||
|
"#include"
|
||||||
|
] @keyword.directive
|
||||||
|
|
||||||
|
[
|
||||||
|
"!"
|
||||||
|
"~"
|
||||||
|
"-"
|
||||||
|
"+"
|
||||||
|
"*"
|
||||||
|
"/"
|
||||||
|
"%"
|
||||||
|
"||"
|
||||||
|
"&&"
|
||||||
|
"|"
|
||||||
|
"^"
|
||||||
|
"&"
|
||||||
|
"=="
|
||||||
|
"!="
|
||||||
|
">"
|
||||||
|
">="
|
||||||
|
"<="
|
||||||
|
">"
|
||||||
|
"<<"
|
||||||
|
">>"
|
||||||
|
] @operator
|
||||||
|
|
||||||
|
[
|
||||||
|
","
|
||||||
|
";"
|
||||||
|
] @punctuation.delimiter
|
||||||
|
|
||||||
|
[
|
||||||
|
"("
|
||||||
|
")"
|
||||||
|
"{"
|
||||||
|
"}"
|
||||||
|
"<"
|
||||||
|
">"
|
||||||
|
] @punctuation.bracket
|
||||||
|
|
||||||
|
(string_literal) @string
|
||||||
|
|
||||||
|
(integer_literal) @constant.numeric.integer
|
||||||
|
|
||||||
|
(call_expression
|
||||||
|
function: (identifier) @function)
|
||||||
|
|
||||||
|
(labeled_item
|
||||||
|
label: (identifier) @label)
|
||||||
|
|
||||||
|
(identifier) @variable
|
||||||
|
|
||||||
|
(unit_address) @tag
|
||||||
|
|
||||||
|
(reference) @constant
|
||||||
|
|
||||||
|
(comment) @comment
|
12
runtime/queries/devicetree/indents.scm
Normal file
12
runtime/queries/devicetree/indents.scm
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
[
|
||||||
|
(node)
|
||||||
|
(byte_string_literal)
|
||||||
|
(parenthesized_expression)
|
||||||
|
(argument_list)
|
||||||
|
] @indent
|
||||||
|
|
||||||
|
[
|
||||||
|
"}"
|
||||||
|
"]"
|
||||||
|
")"
|
||||||
|
] @outdent
|
Loading…
Reference in New Issue
Block a user