Skip to content

Commit 74bb02f

Browse files
authored
feat(languages): specilize toml file-type for cross-rs config file (#14274)
1 parent b81ee02 commit 74bb02f

File tree

6 files changed

+24
-1
lines changed

6 files changed

+24
-1
lines changed

book/src/generated/lang-support.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
| common-lisp || || || `cl-lsp` |
3232
| cpon || || | | |
3333
| cpp |||||| `clangd` |
34+
| cross-config ||| | || `taplo`, `tombi` |
3435
| crystal ||||| | `crystalline`, `ameba-ls` |
3536
| css || || || `vscode-css-language-server` |
3637
| csv || | | | | |

languages.toml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4662,7 +4662,7 @@ scope = "source.kconfig"
46624662
name = "kconfig"
46634663
source = { git = "https://github.com/tree-sitter-grammars/tree-sitter-kconfig" , rev = "9ac99fe4c0c27a35dc6f757cef534c646e944881" }
46644664

4665-
[[language]]
4665+
[[language]]
46664666
name = "doxyfile"
46674667
scope = "source.doxyfile"
46684668
injection-regex = "[Dd]oxyfile"
@@ -4673,3 +4673,13 @@ indent = { tab-width = 4, unit = " " }
46734673
[[grammar]]
46744674
name = "doxyfile"
46754675
source = { git = "https://github.com/tingerrr/tree-sitter-doxyfile/", rev = "18e44c6da639632a4e42264c7193df34be915f34" }
4676+
4677+
[[language]]
4678+
name = "cross-config"
4679+
scope = "source.cross-config"
4680+
injection-regex = "cross(-config)"
4681+
grammar = "toml"
4682+
comment-token = "#"
4683+
file-types = [{glob = "Cross.toml"}]
4684+
language-servers = [ "taplo", "tombi" ]
4685+
indent = { tab-width = 2, unit = " " }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
; inherits: toml
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
((comment) @injection.content
2+
(#set! injection.language "comment"))
3+
4+
; https://github.com/cross-rs/cross/blob/main/docs/config_file.md
5+
(pair
6+
(bare_key) @_key (#eq? @_key "pre-build")
7+
(array
8+
(string) @injection.content)
9+
(#set! injection.language "bash"))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
; inherits: toml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
; inherits: toml

0 commit comments

Comments
 (0)