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>
commitff095ebd9b47bd5b06f16baca8dea9202f8d3c68
authorghashy <109857267+ghashy@users.noreply.github.com>
dateWed 22 Nov 2023, 20:27 (3 years ago)
parentf1b9c19
book/src/generated/lang-support.md+1
@@ -24,6 +24,7 @@
2424| cue | ✓ | | | `cuelsp` |
2525| d | ✓ | ✓ | ✓ | `serve-d` |
2626| dart | ✓ | | ✓ | `dart` |
27+| dbml | ✓ | | | |
2728| devicetree | ✓ | | | |
2829| dhall | ✓ | ✓ | | `dhall-lsp-server` |
2930| diff | ✓ | | | |
languages.toml+12
@@ -2930,3 +2930,15 @@ language-servers = [ "templ" ]
29302930[[grammar]]
29312931name = "templ"
29322932source = { 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+