on master help sign in
Add blueprint language (#7213)

* Add blueprint tree-sitter support * Add blueprint lsp support * Run cargo xtask docgen

commit2022e6175ba72a772b6b6fda4479a8e554e0de02 authorIvan Tkachuk <116971836+seshotake@users.noreply.github.com> dateMon 5 Jun 2023, 11:40 (3 years ago) parent751da01
3 files changed+72
book/src/generated/lang-support.md+1 languages.toml+15 runtime/queries/blueprint/highlights.scm+56
book/src/generated/lang-support.md+1
@@ -7,6 +7,7 @@
77| beancount | ✓ | | | |
88| bibtex | ✓ | | | `texlab` |
99| bicep | ✓ | | | `bicep-langserver` |
10+| blueprint | ✓ | | | `blueprint-compiler` |
1011| c | ✓ | ✓ | ✓ | `clangd` |
1112| c-sharp | ✓ | ✓ | | `OmniSharp` |
1213| cabal | | | | |
languages.toml+15
@@ -77,6 +77,7 @@ vuels = { command = "vls" }
7777wgsl_analyzer = { command = "wgsl_analyzer" }
7878yaml-language-server = { command = "yaml-language-server", args = ["--stdio"] }
7979zls = { command = "zls" }
80+blueprint-compiler = { command = "blueprint-compiler", args = ["lsp"] }
8081
8182
8283[language-server.lua-language-server]
@@ -2577,3 +2578,17 @@ indent = { tab-width = 4, unit = "\t" }
25772578[[grammar]]
25782579name = "just"
25792580source = { git = "https://github.com/IndianBoy42/tree-sitter-just", rev = "8af0aab79854aaf25b620a52c39485849922f766" }
2581+
2582+[[language]]
2583+name = "blueprint"
2584+scope = "source.blueprint"
2585+injection-regex = "blueprint"
2586+file-types = ["blp"]
2587+roots = []
2588+comment-token = "//"
2589+language-servers = [ "blueprint-compiler" ]
2590+indent = { tab-width = 4, unit = " " }
2591+
2592+[[grammar]]
2593+name = "blueprint"
2594+source = { git = "https://gitlab.com/gabmus/tree-sitter-blueprint", rev = "7f1a5df44861291d6951b6b2146a9fef4c226e14" }
runtime/queries/blueprint/highlights.scmnew file+56
@@ -0,0 +1,56 @@
1+(object_id) @attribute
2+
3+(string) @string
4+(escape_sequence) @constant.character.escape
5+
6+(comment) @comment
7+
8+(constant) @constant.builtin
9+(boolean) @constant.builtin.boolean
10+
11+(template) @keyword
12+
13+(using) @keyword.control.import
14+
15+(decorator) @attribute
16+
17+(property_definition (property_name) @variable.other.member)
18+
19+(object) @type
20+
21+(signal_binding (signal_name) @function.builtin)
22+(signal_binding (function (identifier)) @function)
23+(signal_binding "swapped" @keyword)
24+
25+(styles_list "styles" @function.macro)
26+(layout_definition "layout" @function.macro)
27+
28+(gettext_string "_" @function.builtin)
29+
30+(menu_definition "menu" @keyword)
31+(menu_section "section" @keyword)
32+(menu_item "item" @function.macro)
33+
34+(template_definition (template_name_qualifier) @keyword.storage.type)
35+
36+(import_statement (gobject_library) @namespace)
37+
38+(import_statement (version_number) @constant.numeric.float)
39+
40+(float) @constant.numeric.float
41+(number) @constant.numeric
42+
43+[
44+ ";"
45+ "."
46+ ","
47+] @punctuation.delimiter
48+
49+[
50+ "("
51+ ")"
52+ "["
53+ "]"
54+ "{"
55+ "}"
56+] @punctuation.bracket