From 1cdb64bf89a875551ac76700c415dc9042ba3f0f Mon Sep 17 00:00:00 2001 From: seshotake Date: Sat, 3 Jun 2023 09:54:59 +0300 Subject: [PATCH 1/3] Add blueprint tree-sitter support --- book/src/generated/lang-support.md | 1 + languages.toml | 13 ++++++ runtime/queries/blueprint/highlights.scm | 56 ++++++++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 runtime/queries/blueprint/highlights.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index d35966575861..57884fefc4d8 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -7,6 +7,7 @@ | beancount | ✓ | | | | | bibtex | ✓ | | | `texlab` | | bicep | ✓ | | | `bicep-langserver` | +| blueprint | ✓ | | | | | c | ✓ | ✓ | ✓ | `clangd` | | c-sharp | ✓ | ✓ | | `OmniSharp` | | cabal | | | | | diff --git a/languages.toml b/languages.toml index 9e74bf7fb6ed..9b53a7bc5df1 100644 --- a/languages.toml +++ b/languages.toml @@ -2577,3 +2577,16 @@ indent = { tab-width = 4, unit = "\t" } [[grammar]] name = "just" source = { git = "https://github.com/IndianBoy42/tree-sitter-just", rev = "8af0aab79854aaf25b620a52c39485849922f766" } + +[[language]] +name = "blueprint" +scope = "source.blueprint" +injection-regex = "blueprint" +file-types = ["blp"] +roots = [] +comment-token = "//" +indent = { tab-width = 4, unit = " " } + +[[grammar]] +name = "blueprint" +source = { git = "https://gitlab.com/gabmus/tree-sitter-blueprint.git", rev = "7f1a5df44861291d6951b6b2146a9fef4c226e14" } diff --git a/runtime/queries/blueprint/highlights.scm b/runtime/queries/blueprint/highlights.scm new file mode 100644 index 000000000000..05533cea49a0 --- /dev/null +++ b/runtime/queries/blueprint/highlights.scm @@ -0,0 +1,56 @@ +(object_id) @attribute + +(string) @string +(escape_sequence) @constant.character.escape + +(comment) @comment + +(constant) @constant.builtin +(boolean) @constant.builtin.boolean + +(template) @keyword + +(using) @keyword.control.import + +(decorator) @attribute + +(property_definition (property_name) @variable.other.member) + +(object) @type + +(signal_binding (signal_name) @function.builtin) +(signal_binding (function (identifier)) @function) +(signal_binding "swapped" @keyword) + +(styles_list "styles" @function.macro) +(layout_definition "layout" @function.macro) + +(gettext_string "_" @function.builtin) + +(menu_definition "menu" @keyword) +(menu_section "section" @keyword) +(menu_item "item" @function.macro) + +(template_definition (template_name_qualifier) @keyword.storage.type) + +(import_statement (gobject_library) @namespace) + +(import_statement (version_number) @constant.numeric.float) + +(float) @constant.numeric.float +(number) @constant.numeric + +[ + ";" + "." + "," +] @punctuation.delimiter + +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket From 6de8099f3b31b5bceb7be48ba9258d6a97193fdd Mon Sep 17 00:00:00 2001 From: seshotake Date: Mon, 5 Jun 2023 03:30:57 +0300 Subject: [PATCH 2/3] Add blueprint lsp support --- languages.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/languages.toml b/languages.toml index 9b53a7bc5df1..964dc0812278 100644 --- a/languages.toml +++ b/languages.toml @@ -77,6 +77,7 @@ vuels = { command = "vls" } wgsl_analyzer = { command = "wgsl_analyzer" } yaml-language-server = { command = "yaml-language-server", args = ["--stdio"] } zls = { command = "zls" } +blueprint-compiler = { command = "blueprint-compiler", args = ["lsp"] } [language-server.lua-language-server] @@ -2585,8 +2586,9 @@ injection-regex = "blueprint" file-types = ["blp"] roots = [] comment-token = "//" +language-servers = [ "blueprint-compiler" ] indent = { tab-width = 4, unit = " " } [[grammar]] name = "blueprint" -source = { git = "https://gitlab.com/gabmus/tree-sitter-blueprint.git", rev = "7f1a5df44861291d6951b6b2146a9fef4c226e14" } +source = { git = "https://gitlab.com/gabmus/tree-sitter-blueprint", rev = "7f1a5df44861291d6951b6b2146a9fef4c226e14" } From f28edd2826dc3d613e53b263a04d98277cf99624 Mon Sep 17 00:00:00 2001 From: seshotake Date: Mon, 5 Jun 2023 03:47:32 +0300 Subject: [PATCH 3/3] Run cargo xtask docgen --- book/src/generated/lang-support.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 57884fefc4d8..59fe310f0b12 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -7,7 +7,7 @@ | beancount | ✓ | | | | | bibtex | ✓ | | | `texlab` | | bicep | ✓ | | | `bicep-langserver` | -| blueprint | ✓ | | | | +| blueprint | ✓ | | | `blueprint-compiler` | | c | ✓ | ✓ | ✓ | `clangd` | | c-sharp | ✓ | ✓ | | `OmniSharp` | | cabal | | | | |