on master help sign in
DBML Language support (#8860)
ff095ebghashy
book/src/generated/lang-support.md+1
@@ -24,6 +24,7 @@
24| cue | ✓ | | | `cuelsp` |
24| cue | ✓ | | | `cuelsp` |
25| d | ✓ | ✓ | ✓ | `serve-d` |
25| d | ✓ | ✓ | ✓ | `serve-d` |
26| dart | ✓ | | ✓ | `dart` |
26| dart | ✓ | | ✓ | `dart` |
27+| dbml | ✓ | | | |
27| devicetree | ✓ | | | |
28| devicetree | ✓ | | | |
28| dhall | ✓ | ✓ | | `dhall-lsp-server` |
29| dhall | ✓ | ✓ | | `dhall-lsp-server` |
29| diff | ✓ | | | |
30| diff | ✓ | | | |
languages.toml+12
@@ -2930,3 +2930,15 @@ language-servers = [ "templ" ]
2930[[grammar]]
2930[[grammar]]
2931name = "templ"
2931name = "templ"
2932source = { git = "https://github.com/vrischmann/tree-sitter-templ", rev = "ea56ac0655243490a4929a988f4eaa91dfccc995" }
2932source = { git = "https://github.com/vrischmann/tree-sitter-templ", rev = "ea56ac0655243490a4929a988f4eaa91dfccc995" }
2933+
2934+[[language]]
2935+name = "dbml"
2936+scope = "source.dbml"
2937+injection-regex = "dbml"
2938+file-types = ["dbml"]
2939+comment-token = ";"
2940+indent = { tab-width = 2, unit = " " }
2941+
2942+[[grammar]]
2943+name = "dbml"
2944+source = { git = "https://github.com/dynamotn/tree-sitter-dbml", rev = "2e2fa5640268c33c3d3f27f7e676f631a9c68fd9" }
runtime/queries/dbml/highlights.scmnew file+44
@@ -0,0 +1,44 @@
1+
2+; comments highlighting
3+(comment) @comment
4+
5+; keyword highlighting
6+(keyword_def) @keyword
7+(keyword_enum) @keyword
8+(keyword_ref) @keyword
9+
10+; identify blocks and definitions
11+(definition) @function
12+
13+; for identifiers
14+(identifier) @variable
15+(type) @keyword
16+
17+; Highlight special types for database/data types
18+("Project" ) @type
19+("Table" ) @type
20+("TableGroup" ) @type
21+("database_type" ) @variable
22+
23+; string and number constants
24+("'''") @constant.character.escape
25+(string) @string
26+(number) @constant.numeric
27+
28+; brackets
29+[
30+ "("
31+ ")"
32+ "{"
33+ "}"
34+ "["
35+ "]"
36+] @punctuation.bracket
37+
38+; brackets
39+[
40+ ":"
41+ "."
42+ ","
43+] @punctuation.delimiter
44+