mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 01:16:18 +04:00
DBML Language support (#8860)
* DBML language support * DBML language support, highlights.scm added * DBML support * Update runtime/queries/dbml/highlights.scm Co-authored-by: Michael Davis <mcarsondavis@gmail.com> * Update runtime/queries/dbml/highlights.scm Co-authored-by: Michael Davis <mcarsondavis@gmail.com> * Update runtime/queries/dbml/highlights.scm Co-authored-by: Michael Davis <mcarsondavis@gmail.com> * remove unnecessary block highlight * remove unnecessary line * remove index_block query --------- Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
This commit is contained in:
parent
f1b9c19fa9
commit
ff095ebd9b
@ -24,6 +24,7 @@
|
|||||||
| cue | ✓ | | | `cuelsp` |
|
| cue | ✓ | | | `cuelsp` |
|
||||||
| d | ✓ | ✓ | ✓ | `serve-d` |
|
| d | ✓ | ✓ | ✓ | `serve-d` |
|
||||||
| dart | ✓ | | ✓ | `dart` |
|
| dart | ✓ | | ✓ | `dart` |
|
||||||
|
| dbml | ✓ | | | |
|
||||||
| devicetree | ✓ | | | |
|
| devicetree | ✓ | | | |
|
||||||
| dhall | ✓ | ✓ | | `dhall-lsp-server` |
|
| dhall | ✓ | ✓ | | `dhall-lsp-server` |
|
||||||
| diff | ✓ | | | |
|
| diff | ✓ | | | |
|
||||||
|
@ -2930,3 +2930,15 @@ language-servers = [ "templ" ]
|
|||||||
[[grammar]]
|
[[grammar]]
|
||||||
name = "templ"
|
name = "templ"
|
||||||
source = { git = "https://github.com/vrischmann/tree-sitter-templ", rev = "ea56ac0655243490a4929a988f4eaa91dfccc995" }
|
source = { git = "https://github.com/vrischmann/tree-sitter-templ", rev = "ea56ac0655243490a4929a988f4eaa91dfccc995" }
|
||||||
|
|
||||||
|
[[language]]
|
||||||
|
name = "dbml"
|
||||||
|
scope = "source.dbml"
|
||||||
|
injection-regex = "dbml"
|
||||||
|
file-types = ["dbml"]
|
||||||
|
comment-token = ";"
|
||||||
|
indent = { tab-width = 2, unit = " " }
|
||||||
|
|
||||||
|
[[grammar]]
|
||||||
|
name = "dbml"
|
||||||
|
source = { git = "https://github.com/dynamotn/tree-sitter-dbml", rev = "2e2fa5640268c33c3d3f27f7e676f631a9c68fd9" }
|
||||||
|
44
runtime/queries/dbml/highlights.scm
Normal file
44
runtime/queries/dbml/highlights.scm
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
|
||||||
|
; comments highlighting
|
||||||
|
(comment) @comment
|
||||||
|
|
||||||
|
; keyword highlighting
|
||||||
|
(keyword_def) @keyword
|
||||||
|
(keyword_enum) @keyword
|
||||||
|
(keyword_ref) @keyword
|
||||||
|
|
||||||
|
; identify blocks and definitions
|
||||||
|
(definition) @function
|
||||||
|
|
||||||
|
; for identifiers
|
||||||
|
(identifier) @variable
|
||||||
|
(type) @keyword
|
||||||
|
|
||||||
|
; Highlight special types for database/data types
|
||||||
|
("Project" ) @type
|
||||||
|
("Table" ) @type
|
||||||
|
("TableGroup" ) @type
|
||||||
|
("database_type" ) @variable
|
||||||
|
|
||||||
|
; string and number constants
|
||||||
|
("'''") @constant.character.escape
|
||||||
|
(string) @string
|
||||||
|
(number) @constant.numeric
|
||||||
|
|
||||||
|
; brackets
|
||||||
|
[
|
||||||
|
"("
|
||||||
|
")"
|
||||||
|
"{"
|
||||||
|
"}"
|
||||||
|
"["
|
||||||
|
"]"
|
||||||
|
] @punctuation.bracket
|
||||||
|
|
||||||
|
; brackets
|
||||||
|
[
|
||||||
|
":"
|
||||||
|
"."
|
||||||
|
","
|
||||||
|
] @punctuation.delimiter
|
||||||
|
|
Loading…
Reference in New Issue
Block a user