From d47d02e7e9dbeaf18dd4922f404ef7a041394fd4 Mon Sep 17 00:00:00 2001 From: Brett Lyons Date: Thu, 2 Feb 2023 14:27:23 -0700 Subject: [PATCH 1/2] Added MSBuild to languages.toml based on XML grammar --- languages.toml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/languages.toml b/languages.toml index 755f577ffa0e..4bb55d5b1f08 100644 --- a/languages.toml +++ b/languages.toml @@ -2117,3 +2117,23 @@ roots = [] comment-token = "#" indent = { tab-width = 4, unit = " " } grammar = "python" + +[[language]] +name = "MSBuild" +scope = "source.xml" +injection-regex = "xml" +file-types = [".proj", ".vbproj", ".csproj", ".fsproj", ".targets", ".props"] +indent = { tab-width = 2, unit = " " } +roots = [] + +[language.auto-pairs] +'(' = ')' +'{' = '}' +'[' = ']' +'"' = '"' +"'" = "'" +"<" = ">" + +[[grammar]] +name = "MSBuild" +source = { git = "https://github.com/RenjiSann/tree-sitter-xml", rev = "48a7c2b6fb9d515577e115e6788937e837815651" } From 68a6cbbed9a05358f61c52c9c1a31203ac1240b7 Mon Sep 17 00:00:00 2001 From: Brett Lyons Date: Thu, 2 Feb 2023 19:06:37 -0700 Subject: [PATCH 2/2] Added runtime/queries/msbuild/{highlights.scm, indents.scm, injections.scm}, fixed languages.toml and ran docgen --- book/src/generated/lang-support.md | 1 + languages.toml | 13 +++++-------- runtime/queries/msbuild/highlights.scm | 1 + runtime/queries/msbuild/indents.scm | 1 + runtime/queries/msbuild/injections.scm | 1 + 5 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 runtime/queries/msbuild/highlights.scm create mode 100644 runtime/queries/msbuild/indents.scm create mode 100644 runtime/queries/msbuild/injections.scm diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 1711ec36d5bf..99fe82b33159 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -83,6 +83,7 @@ | mermaid | ✓ | | | | | meson | ✓ | | ✓ | | | mint | | | | `mint` | +| msbuild | ✓ | | ✓ | | | nickel | ✓ | | ✓ | `nls` | | nix | ✓ | | | `nil` | | nu | ✓ | | | | diff --git a/languages.toml b/languages.toml index 4bb55d5b1f08..0a0c3dc0f125 100644 --- a/languages.toml +++ b/languages.toml @@ -2119,12 +2119,13 @@ indent = { tab-width = 4, unit = " " } grammar = "python" [[language]] -name = "MSBuild" -scope = "source.xml" -injection-regex = "xml" -file-types = [".proj", ".vbproj", ".csproj", ".fsproj", ".targets", ".props"] +name = "msbuild" +scope = "source.msbuild" +injection-regex = "msbuild" +file-types = ["proj", "vbproj", "csproj", "fsproj", "targets", "props"] indent = { tab-width = 2, unit = " " } roots = [] +grammar = "xml" [language.auto-pairs] '(' = ')' @@ -2133,7 +2134,3 @@ roots = [] '"' = '"' "'" = "'" "<" = ">" - -[[grammar]] -name = "MSBuild" -source = { git = "https://github.com/RenjiSann/tree-sitter-xml", rev = "48a7c2b6fb9d515577e115e6788937e837815651" } diff --git a/runtime/queries/msbuild/highlights.scm b/runtime/queries/msbuild/highlights.scm new file mode 100644 index 000000000000..27b10d95d8b6 --- /dev/null +++ b/runtime/queries/msbuild/highlights.scm @@ -0,0 +1 @@ +; inherits: xml diff --git a/runtime/queries/msbuild/indents.scm b/runtime/queries/msbuild/indents.scm new file mode 100644 index 000000000000..27b10d95d8b6 --- /dev/null +++ b/runtime/queries/msbuild/indents.scm @@ -0,0 +1 @@ +; inherits: xml diff --git a/runtime/queries/msbuild/injections.scm b/runtime/queries/msbuild/injections.scm new file mode 100644 index 000000000000..27b10d95d8b6 --- /dev/null +++ b/runtime/queries/msbuild/injections.scm @@ -0,0 +1 @@ +; inherits: xml