From 3c0b83f66d960b5e4fe19041035e9ed83377f7c9 Mon Sep 17 00:00:00 2001 From: Sathiyaraman M Date: Sun, 1 Mar 2026 11:48:46 +0530 Subject: [PATCH 1/7] Support highlighting for C# project files Includes highlighting for csproj, props and targets files --- extension.toml | 5 + languages/csproj/config.toml | 9 ++ languages/csproj/highlights.scm | 168 ++++++++++++++++++++++++++++++++ languages/csproj/indents.scm | 2 + languages/csproj/outline.scm | 9 ++ 5 files changed, 193 insertions(+) create mode 100644 languages/csproj/config.toml create mode 100644 languages/csproj/highlights.scm create mode 100644 languages/csproj/indents.scm create mode 100644 languages/csproj/outline.scm diff --git a/extension.toml b/extension.toml index c893035..ae95eeb 100644 --- a/extension.toml +++ b/extension.toml @@ -24,3 +24,8 @@ language = "CSharp" [grammars.c_sharp] repository = "https://github.com/tree-sitter/tree-sitter-c-sharp" commit = "485f0bae0274ac9114797fc10db6f7034e4086e3" + +[grammars.xml] +repository = "https://github.com/tree-sitter-grammars/tree-sitter-xml" +commit = "863dbc381f44f6c136a399e684383b977bb2beaa" +path = "xml" diff --git a/languages/csproj/config.toml b/languages/csproj/config.toml new file mode 100644 index 0000000..62c00a2 --- /dev/null +++ b/languages/csproj/config.toml @@ -0,0 +1,9 @@ +name = "C# Project File" +grammar = "xml" +path_suffixes = ["csproj", "props", "targets"] +block_comment = [""] +autoclose_before = "<" +brackets = [{ start = "<", end = ">", close = true, newline = true }] +prettier_parser_name = "xml" +prettier_plugins = ["@prettier/plugin-xml"] +hard_tabs = true \ No newline at end of file diff --git a/languages/csproj/highlights.scm b/languages/csproj/highlights.scm new file mode 100644 index 0000000..c14be81 --- /dev/null +++ b/languages/csproj/highlights.scm @@ -0,0 +1,168 @@ +;; XML declaration + +"xml" @keyword + +[ "version" "encoding" "standalone" ] @property + +(EncName) @string.special + +(VersionNum) @number + +[ "yes" "no" ] @boolean + +;; Processing instructions + +(PI) @embedded + +(PI (PITarget) @keyword) + +;; Element declaration + +(elementdecl + "ELEMENT" @keyword + (Name) @tag) + +(contentspec + (_ (Name) @property)) + +"#PCDATA" @type.builtin + +[ "EMPTY" "ANY" ] @string.special.symbol + +[ "*" "?" "+" ] @operator + +;; Entity declaration + +(GEDecl + "ENTITY" @keyword + (Name) @constant) + +(GEDecl (EntityValue) @string) + +(NDataDecl + "NDATA" @keyword + (Name) @label) + +;; Parsed entity declaration + +(PEDecl + "ENTITY" @keyword + "%" @operator + (Name) @constant) + +(PEDecl (EntityValue) @string) + +;; Notation declaration + +(NotationDecl + "NOTATION" @keyword + (Name) @constant) + +(NotationDecl + (ExternalID + (SystemLiteral (URI) @string.special))) + +;; Attlist declaration + +(AttlistDecl + "ATTLIST" @keyword + (Name) @tag) + +(AttDef (Name) @property) + +(AttDef (Enumeration (Nmtoken) @string)) + +(DefaultDecl (AttValue) @string) + +[ + (StringType) + (TokenizedType) +] @type.builtin + +(NotationType "NOTATION" @type.builtin) + +[ + "#REQUIRED" + "#IMPLIED" + "#FIXED" +] @attribute + +;; Entities + +(EntityRef) @constant + +((EntityRef) @constant.builtin + (#any-of? @constant.builtin + "&" "<" ">" """ "'")) + +(CharRef) @constant + +(PEReference) @constant + +;; External references + +[ "PUBLIC" "SYSTEM" ] @keyword + +(PubidLiteral) @string.special + +(SystemLiteral (URI) @markup.link) + +;; Processing instructions + +(XmlModelPI "xml-model" @keyword) + +(StyleSheetPI "xml-stylesheet" @keyword) + +(PseudoAtt (Name) @property) + +(PseudoAtt (PseudoAttValue) @string) + +;; Doctype declaration + +(doctypedecl "DOCTYPE" @keyword) + +(doctypedecl (Name) @type) + +;; Tags + +(STag (Name) @tag) + +(ETag (Name) @tag) + +(EmptyElemTag (Name) @tag) + +;; Attributes + +(Attribute (Name) @property) + +(Attribute (AttValue) @string) + +;; Delimiters & punctuation + +[ + "" + "" + "<" ">" + "" +] @punctuation.delimiter + +[ "(" ")" "[" "]" ] @punctuation.bracket + +[ "\"" "'" ] @punctuation.delimiter + +[ "," "|" "=" ] @operator + +;; Text + +(CharData) @markup + +(CDSect + (CDStart) @markup.heading + (CData) @markup.raw + "]]>" @markup.heading) + +;; Misc + +(Comment) @comment + +(ERROR) @error \ No newline at end of file diff --git a/languages/csproj/indents.scm b/languages/csproj/indents.scm new file mode 100644 index 0000000..febed05 --- /dev/null +++ b/languages/csproj/indents.scm @@ -0,0 +1,2 @@ +(STag ">" @end) @indent +(EmptyElemTag "/>" @end) @indent \ No newline at end of file diff --git a/languages/csproj/outline.scm b/languages/csproj/outline.scm new file mode 100644 index 0000000..601af71 --- /dev/null +++ b/languages/csproj/outline.scm @@ -0,0 +1,9 @@ +(element + (STag + (Name) @name)) @item + +(EmptyElemTag + (Name) @name) @item + +(doctypedecl + (Name) @name) @item \ No newline at end of file From bd87e292e41855c6199086017f15a6d18905d296 Mon Sep 17 00:00:00 2001 From: Sathiyaraman M Date: Sun, 1 Mar 2026 11:58:09 +0530 Subject: [PATCH 2/7] Split single grammar separately for each file type --- languages/csproj/config.toml | 2 +- languages/props/config.toml | 9 ++ languages/props/highlights.scm | 168 +++++++++++++++++++++++++++++++ languages/props/indents.scm | 2 + languages/props/outline.scm | 9 ++ languages/targets/config.toml | 9 ++ languages/targets/highlights.scm | 168 +++++++++++++++++++++++++++++++ languages/targets/indents.scm | 2 + languages/targets/outline.scm | 9 ++ 9 files changed, 377 insertions(+), 1 deletion(-) create mode 100644 languages/props/config.toml create mode 100644 languages/props/highlights.scm create mode 100644 languages/props/indents.scm create mode 100644 languages/props/outline.scm create mode 100644 languages/targets/config.toml create mode 100644 languages/targets/highlights.scm create mode 100644 languages/targets/indents.scm create mode 100644 languages/targets/outline.scm diff --git a/languages/csproj/config.toml b/languages/csproj/config.toml index 62c00a2..502a10c 100644 --- a/languages/csproj/config.toml +++ b/languages/csproj/config.toml @@ -1,6 +1,6 @@ name = "C# Project File" grammar = "xml" -path_suffixes = ["csproj", "props", "targets"] +path_suffixes = ["csproj"] block_comment = [""] autoclose_before = "<" brackets = [{ start = "<", end = ">", close = true, newline = true }] diff --git a/languages/props/config.toml b/languages/props/config.toml new file mode 100644 index 0000000..9463048 --- /dev/null +++ b/languages/props/config.toml @@ -0,0 +1,9 @@ +name = "C# Props File" +grammar = "xml" +path_suffixes = ["props"] +block_comment = [""] +autoclose_before = "<" +brackets = [{ start = "<", end = ">", close = true, newline = true }] +prettier_parser_name = "xml" +prettier_plugins = ["@prettier/plugin-xml"] +hard_tabs = true \ No newline at end of file diff --git a/languages/props/highlights.scm b/languages/props/highlights.scm new file mode 100644 index 0000000..c14be81 --- /dev/null +++ b/languages/props/highlights.scm @@ -0,0 +1,168 @@ +;; XML declaration + +"xml" @keyword + +[ "version" "encoding" "standalone" ] @property + +(EncName) @string.special + +(VersionNum) @number + +[ "yes" "no" ] @boolean + +;; Processing instructions + +(PI) @embedded + +(PI (PITarget) @keyword) + +;; Element declaration + +(elementdecl + "ELEMENT" @keyword + (Name) @tag) + +(contentspec + (_ (Name) @property)) + +"#PCDATA" @type.builtin + +[ "EMPTY" "ANY" ] @string.special.symbol + +[ "*" "?" "+" ] @operator + +;; Entity declaration + +(GEDecl + "ENTITY" @keyword + (Name) @constant) + +(GEDecl (EntityValue) @string) + +(NDataDecl + "NDATA" @keyword + (Name) @label) + +;; Parsed entity declaration + +(PEDecl + "ENTITY" @keyword + "%" @operator + (Name) @constant) + +(PEDecl (EntityValue) @string) + +;; Notation declaration + +(NotationDecl + "NOTATION" @keyword + (Name) @constant) + +(NotationDecl + (ExternalID + (SystemLiteral (URI) @string.special))) + +;; Attlist declaration + +(AttlistDecl + "ATTLIST" @keyword + (Name) @tag) + +(AttDef (Name) @property) + +(AttDef (Enumeration (Nmtoken) @string)) + +(DefaultDecl (AttValue) @string) + +[ + (StringType) + (TokenizedType) +] @type.builtin + +(NotationType "NOTATION" @type.builtin) + +[ + "#REQUIRED" + "#IMPLIED" + "#FIXED" +] @attribute + +;; Entities + +(EntityRef) @constant + +((EntityRef) @constant.builtin + (#any-of? @constant.builtin + "&" "<" ">" """ "'")) + +(CharRef) @constant + +(PEReference) @constant + +;; External references + +[ "PUBLIC" "SYSTEM" ] @keyword + +(PubidLiteral) @string.special + +(SystemLiteral (URI) @markup.link) + +;; Processing instructions + +(XmlModelPI "xml-model" @keyword) + +(StyleSheetPI "xml-stylesheet" @keyword) + +(PseudoAtt (Name) @property) + +(PseudoAtt (PseudoAttValue) @string) + +;; Doctype declaration + +(doctypedecl "DOCTYPE" @keyword) + +(doctypedecl (Name) @type) + +;; Tags + +(STag (Name) @tag) + +(ETag (Name) @tag) + +(EmptyElemTag (Name) @tag) + +;; Attributes + +(Attribute (Name) @property) + +(Attribute (AttValue) @string) + +;; Delimiters & punctuation + +[ + "" + "" + "<" ">" + "" +] @punctuation.delimiter + +[ "(" ")" "[" "]" ] @punctuation.bracket + +[ "\"" "'" ] @punctuation.delimiter + +[ "," "|" "=" ] @operator + +;; Text + +(CharData) @markup + +(CDSect + (CDStart) @markup.heading + (CData) @markup.raw + "]]>" @markup.heading) + +;; Misc + +(Comment) @comment + +(ERROR) @error \ No newline at end of file diff --git a/languages/props/indents.scm b/languages/props/indents.scm new file mode 100644 index 0000000..febed05 --- /dev/null +++ b/languages/props/indents.scm @@ -0,0 +1,2 @@ +(STag ">" @end) @indent +(EmptyElemTag "/>" @end) @indent \ No newline at end of file diff --git a/languages/props/outline.scm b/languages/props/outline.scm new file mode 100644 index 0000000..601af71 --- /dev/null +++ b/languages/props/outline.scm @@ -0,0 +1,9 @@ +(element + (STag + (Name) @name)) @item + +(EmptyElemTag + (Name) @name) @item + +(doctypedecl + (Name) @name) @item \ No newline at end of file diff --git a/languages/targets/config.toml b/languages/targets/config.toml new file mode 100644 index 0000000..74d176b --- /dev/null +++ b/languages/targets/config.toml @@ -0,0 +1,9 @@ +name = "C# Targets File" +grammar = "xml" +path_suffixes = ["targets"] +block_comment = [""] +autoclose_before = "<" +brackets = [{ start = "<", end = ">", close = true, newline = true }] +prettier_parser_name = "xml" +prettier_plugins = ["@prettier/plugin-xml"] +hard_tabs = true \ No newline at end of file diff --git a/languages/targets/highlights.scm b/languages/targets/highlights.scm new file mode 100644 index 0000000..c14be81 --- /dev/null +++ b/languages/targets/highlights.scm @@ -0,0 +1,168 @@ +;; XML declaration + +"xml" @keyword + +[ "version" "encoding" "standalone" ] @property + +(EncName) @string.special + +(VersionNum) @number + +[ "yes" "no" ] @boolean + +;; Processing instructions + +(PI) @embedded + +(PI (PITarget) @keyword) + +;; Element declaration + +(elementdecl + "ELEMENT" @keyword + (Name) @tag) + +(contentspec + (_ (Name) @property)) + +"#PCDATA" @type.builtin + +[ "EMPTY" "ANY" ] @string.special.symbol + +[ "*" "?" "+" ] @operator + +;; Entity declaration + +(GEDecl + "ENTITY" @keyword + (Name) @constant) + +(GEDecl (EntityValue) @string) + +(NDataDecl + "NDATA" @keyword + (Name) @label) + +;; Parsed entity declaration + +(PEDecl + "ENTITY" @keyword + "%" @operator + (Name) @constant) + +(PEDecl (EntityValue) @string) + +;; Notation declaration + +(NotationDecl + "NOTATION" @keyword + (Name) @constant) + +(NotationDecl + (ExternalID + (SystemLiteral (URI) @string.special))) + +;; Attlist declaration + +(AttlistDecl + "ATTLIST" @keyword + (Name) @tag) + +(AttDef (Name) @property) + +(AttDef (Enumeration (Nmtoken) @string)) + +(DefaultDecl (AttValue) @string) + +[ + (StringType) + (TokenizedType) +] @type.builtin + +(NotationType "NOTATION" @type.builtin) + +[ + "#REQUIRED" + "#IMPLIED" + "#FIXED" +] @attribute + +;; Entities + +(EntityRef) @constant + +((EntityRef) @constant.builtin + (#any-of? @constant.builtin + "&" "<" ">" """ "'")) + +(CharRef) @constant + +(PEReference) @constant + +;; External references + +[ "PUBLIC" "SYSTEM" ] @keyword + +(PubidLiteral) @string.special + +(SystemLiteral (URI) @markup.link) + +;; Processing instructions + +(XmlModelPI "xml-model" @keyword) + +(StyleSheetPI "xml-stylesheet" @keyword) + +(PseudoAtt (Name) @property) + +(PseudoAtt (PseudoAttValue) @string) + +;; Doctype declaration + +(doctypedecl "DOCTYPE" @keyword) + +(doctypedecl (Name) @type) + +;; Tags + +(STag (Name) @tag) + +(ETag (Name) @tag) + +(EmptyElemTag (Name) @tag) + +;; Attributes + +(Attribute (Name) @property) + +(Attribute (AttValue) @string) + +;; Delimiters & punctuation + +[ + "" + "" + "<" ">" + "" +] @punctuation.delimiter + +[ "(" ")" "[" "]" ] @punctuation.bracket + +[ "\"" "'" ] @punctuation.delimiter + +[ "," "|" "=" ] @operator + +;; Text + +(CharData) @markup + +(CDSect + (CDStart) @markup.heading + (CData) @markup.raw + "]]>" @markup.heading) + +;; Misc + +(Comment) @comment + +(ERROR) @error \ No newline at end of file diff --git a/languages/targets/indents.scm b/languages/targets/indents.scm new file mode 100644 index 0000000..febed05 --- /dev/null +++ b/languages/targets/indents.scm @@ -0,0 +1,2 @@ +(STag ">" @end) @indent +(EmptyElemTag "/>" @end) @indent \ No newline at end of file diff --git a/languages/targets/outline.scm b/languages/targets/outline.scm new file mode 100644 index 0000000..601af71 --- /dev/null +++ b/languages/targets/outline.scm @@ -0,0 +1,9 @@ +(element + (STag + (Name) @name)) @item + +(EmptyElemTag + (Name) @name) @item + +(doctypedecl + (Name) @name) @item \ No newline at end of file From 15d8e1a96cc0b49c6bab36d291c4c77434b80b91 Mon Sep 17 00:00:00 2001 From: Sathiyaraman M Date: Sun, 1 Mar 2026 11:58:32 +0530 Subject: [PATCH 3/7] Support highlighting for slnx files --- languages/slnx/config.toml | 9 ++ languages/slnx/highlights.scm | 168 ++++++++++++++++++++++++++++++++++ languages/slnx/indents.scm | 2 + languages/slnx/outline.scm | 9 ++ 4 files changed, 188 insertions(+) create mode 100644 languages/slnx/config.toml create mode 100644 languages/slnx/highlights.scm create mode 100644 languages/slnx/indents.scm create mode 100644 languages/slnx/outline.scm diff --git a/languages/slnx/config.toml b/languages/slnx/config.toml new file mode 100644 index 0000000..fa3fffd --- /dev/null +++ b/languages/slnx/config.toml @@ -0,0 +1,9 @@ +name = "C# Solution File" +grammar = "xml" +path_suffixes = ["slnx"] +block_comment = [""] +autoclose_before = "<" +brackets = [{ start = "<", end = ">", close = true, newline = true }] +prettier_parser_name = "xml" +prettier_plugins = ["@prettier/plugin-xml"] +hard_tabs = true \ No newline at end of file diff --git a/languages/slnx/highlights.scm b/languages/slnx/highlights.scm new file mode 100644 index 0000000..c14be81 --- /dev/null +++ b/languages/slnx/highlights.scm @@ -0,0 +1,168 @@ +;; XML declaration + +"xml" @keyword + +[ "version" "encoding" "standalone" ] @property + +(EncName) @string.special + +(VersionNum) @number + +[ "yes" "no" ] @boolean + +;; Processing instructions + +(PI) @embedded + +(PI (PITarget) @keyword) + +;; Element declaration + +(elementdecl + "ELEMENT" @keyword + (Name) @tag) + +(contentspec + (_ (Name) @property)) + +"#PCDATA" @type.builtin + +[ "EMPTY" "ANY" ] @string.special.symbol + +[ "*" "?" "+" ] @operator + +;; Entity declaration + +(GEDecl + "ENTITY" @keyword + (Name) @constant) + +(GEDecl (EntityValue) @string) + +(NDataDecl + "NDATA" @keyword + (Name) @label) + +;; Parsed entity declaration + +(PEDecl + "ENTITY" @keyword + "%" @operator + (Name) @constant) + +(PEDecl (EntityValue) @string) + +;; Notation declaration + +(NotationDecl + "NOTATION" @keyword + (Name) @constant) + +(NotationDecl + (ExternalID + (SystemLiteral (URI) @string.special))) + +;; Attlist declaration + +(AttlistDecl + "ATTLIST" @keyword + (Name) @tag) + +(AttDef (Name) @property) + +(AttDef (Enumeration (Nmtoken) @string)) + +(DefaultDecl (AttValue) @string) + +[ + (StringType) + (TokenizedType) +] @type.builtin + +(NotationType "NOTATION" @type.builtin) + +[ + "#REQUIRED" + "#IMPLIED" + "#FIXED" +] @attribute + +;; Entities + +(EntityRef) @constant + +((EntityRef) @constant.builtin + (#any-of? @constant.builtin + "&" "<" ">" """ "'")) + +(CharRef) @constant + +(PEReference) @constant + +;; External references + +[ "PUBLIC" "SYSTEM" ] @keyword + +(PubidLiteral) @string.special + +(SystemLiteral (URI) @markup.link) + +;; Processing instructions + +(XmlModelPI "xml-model" @keyword) + +(StyleSheetPI "xml-stylesheet" @keyword) + +(PseudoAtt (Name) @property) + +(PseudoAtt (PseudoAttValue) @string) + +;; Doctype declaration + +(doctypedecl "DOCTYPE" @keyword) + +(doctypedecl (Name) @type) + +;; Tags + +(STag (Name) @tag) + +(ETag (Name) @tag) + +(EmptyElemTag (Name) @tag) + +;; Attributes + +(Attribute (Name) @property) + +(Attribute (AttValue) @string) + +;; Delimiters & punctuation + +[ + "" + "" + "<" ">" + "" +] @punctuation.delimiter + +[ "(" ")" "[" "]" ] @punctuation.bracket + +[ "\"" "'" ] @punctuation.delimiter + +[ "," "|" "=" ] @operator + +;; Text + +(CharData) @markup + +(CDSect + (CDStart) @markup.heading + (CData) @markup.raw + "]]>" @markup.heading) + +;; Misc + +(Comment) @comment + +(ERROR) @error \ No newline at end of file diff --git a/languages/slnx/indents.scm b/languages/slnx/indents.scm new file mode 100644 index 0000000..febed05 --- /dev/null +++ b/languages/slnx/indents.scm @@ -0,0 +1,2 @@ +(STag ">" @end) @indent +(EmptyElemTag "/>" @end) @indent \ No newline at end of file diff --git a/languages/slnx/outline.scm b/languages/slnx/outline.scm new file mode 100644 index 0000000..601af71 --- /dev/null +++ b/languages/slnx/outline.scm @@ -0,0 +1,9 @@ +(element + (STag + (Name) @name)) @item + +(EmptyElemTag + (Name) @name) @item + +(doctypedecl + (Name) @name) @item \ No newline at end of file From ab7a85aa48e1547c9610ff8f6a0bc2b199a05744 Mon Sep 17 00:00:00 2001 From: Sathiyaraman M Date: Sun, 1 Mar 2026 11:58:49 +0530 Subject: [PATCH 4/7] Add tasks for csproj and slnx files --- languages/csproj/tasks.json | 24 ++++++++++++++++++++++++ languages/slnx/tasks.json | 24 ++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 languages/csproj/tasks.json create mode 100644 languages/slnx/tasks.json diff --git a/languages/csproj/tasks.json b/languages/csproj/tasks.json new file mode 100644 index 0000000..d436a87 --- /dev/null +++ b/languages/csproj/tasks.json @@ -0,0 +1,24 @@ +[ + { + "label": "Restore Current Project", + "command": "dotnet restore", + "args": ["$ZED_FILE"], + "use_new_terminal": false, + "allow_concurrent_runs": false, + "reveal": "always", + "reveal_target": "center", + "hide": "on_success", + "shell": "system" + }, + { + "label": "Build Current Project", + "command": "dotnet build", + "args": ["$ZED_FILE"], + "use_new_terminal": false, + "allow_concurrent_runs": false, + "reveal": "always", + "reveal_target": "center", + "hide": "on_success", + "shell": "system" + } +] diff --git a/languages/slnx/tasks.json b/languages/slnx/tasks.json new file mode 100644 index 0000000..d39c312 --- /dev/null +++ b/languages/slnx/tasks.json @@ -0,0 +1,24 @@ +[ + { + "label": "Restore Current Solution", + "command": "dotnet restore", + "args": ["$ZED_FILE"], + "use_new_terminal": false, + "allow_concurrent_runs": false, + "reveal": "always", + "reveal_target": "center", + "hide": "on_success", + "shell": "system" + }, + { + "label": "Build Current Solution", + "command": "dotnet build", + "args": ["$ZED_FILE"], + "use_new_terminal": false, + "allow_concurrent_runs": false, + "reveal": "always", + "reveal_target": "center", + "hide": "on_success", + "shell": "system" + } +] From 1d9a918ad3c68c6937f45b183fd0012e28964a9c Mon Sep 17 00:00:00 2001 From: Sathiyaraman M Date: Fri, 5 Jun 2026 08:41:45 +0530 Subject: [PATCH 5/7] Merge props and targets into single lang MSBuild --- languages/{props => msbuild}/config.toml | 4 +- languages/{props => msbuild}/highlights.scm | 0 languages/{props => msbuild}/indents.scm | 0 languages/{props => msbuild}/outline.scm | 0 languages/targets/config.toml | 9 -- languages/targets/highlights.scm | 168 -------------------- languages/targets/indents.scm | 2 - languages/targets/outline.scm | 9 -- 8 files changed, 2 insertions(+), 190 deletions(-) rename languages/{props => msbuild}/config.toml (77%) rename languages/{props => msbuild}/highlights.scm (100%) rename languages/{props => msbuild}/indents.scm (100%) rename languages/{props => msbuild}/outline.scm (100%) delete mode 100644 languages/targets/config.toml delete mode 100644 languages/targets/highlights.scm delete mode 100644 languages/targets/indents.scm delete mode 100644 languages/targets/outline.scm diff --git a/languages/props/config.toml b/languages/msbuild/config.toml similarity index 77% rename from languages/props/config.toml rename to languages/msbuild/config.toml index 9463048..dd8d49b 100644 --- a/languages/props/config.toml +++ b/languages/msbuild/config.toml @@ -1,6 +1,6 @@ -name = "C# Props File" +name = "MSBuild File" grammar = "xml" -path_suffixes = ["props"] +path_suffixes = ["proj", "props", "targets"] block_comment = [""] autoclose_before = "<" brackets = [{ start = "<", end = ">", close = true, newline = true }] diff --git a/languages/props/highlights.scm b/languages/msbuild/highlights.scm similarity index 100% rename from languages/props/highlights.scm rename to languages/msbuild/highlights.scm diff --git a/languages/props/indents.scm b/languages/msbuild/indents.scm similarity index 100% rename from languages/props/indents.scm rename to languages/msbuild/indents.scm diff --git a/languages/props/outline.scm b/languages/msbuild/outline.scm similarity index 100% rename from languages/props/outline.scm rename to languages/msbuild/outline.scm diff --git a/languages/targets/config.toml b/languages/targets/config.toml deleted file mode 100644 index 74d176b..0000000 --- a/languages/targets/config.toml +++ /dev/null @@ -1,9 +0,0 @@ -name = "C# Targets File" -grammar = "xml" -path_suffixes = ["targets"] -block_comment = [""] -autoclose_before = "<" -brackets = [{ start = "<", end = ">", close = true, newline = true }] -prettier_parser_name = "xml" -prettier_plugins = ["@prettier/plugin-xml"] -hard_tabs = true \ No newline at end of file diff --git a/languages/targets/highlights.scm b/languages/targets/highlights.scm deleted file mode 100644 index c14be81..0000000 --- a/languages/targets/highlights.scm +++ /dev/null @@ -1,168 +0,0 @@ -;; XML declaration - -"xml" @keyword - -[ "version" "encoding" "standalone" ] @property - -(EncName) @string.special - -(VersionNum) @number - -[ "yes" "no" ] @boolean - -;; Processing instructions - -(PI) @embedded - -(PI (PITarget) @keyword) - -;; Element declaration - -(elementdecl - "ELEMENT" @keyword - (Name) @tag) - -(contentspec - (_ (Name) @property)) - -"#PCDATA" @type.builtin - -[ "EMPTY" "ANY" ] @string.special.symbol - -[ "*" "?" "+" ] @operator - -;; Entity declaration - -(GEDecl - "ENTITY" @keyword - (Name) @constant) - -(GEDecl (EntityValue) @string) - -(NDataDecl - "NDATA" @keyword - (Name) @label) - -;; Parsed entity declaration - -(PEDecl - "ENTITY" @keyword - "%" @operator - (Name) @constant) - -(PEDecl (EntityValue) @string) - -;; Notation declaration - -(NotationDecl - "NOTATION" @keyword - (Name) @constant) - -(NotationDecl - (ExternalID - (SystemLiteral (URI) @string.special))) - -;; Attlist declaration - -(AttlistDecl - "ATTLIST" @keyword - (Name) @tag) - -(AttDef (Name) @property) - -(AttDef (Enumeration (Nmtoken) @string)) - -(DefaultDecl (AttValue) @string) - -[ - (StringType) - (TokenizedType) -] @type.builtin - -(NotationType "NOTATION" @type.builtin) - -[ - "#REQUIRED" - "#IMPLIED" - "#FIXED" -] @attribute - -;; Entities - -(EntityRef) @constant - -((EntityRef) @constant.builtin - (#any-of? @constant.builtin - "&" "<" ">" """ "'")) - -(CharRef) @constant - -(PEReference) @constant - -;; External references - -[ "PUBLIC" "SYSTEM" ] @keyword - -(PubidLiteral) @string.special - -(SystemLiteral (URI) @markup.link) - -;; Processing instructions - -(XmlModelPI "xml-model" @keyword) - -(StyleSheetPI "xml-stylesheet" @keyword) - -(PseudoAtt (Name) @property) - -(PseudoAtt (PseudoAttValue) @string) - -;; Doctype declaration - -(doctypedecl "DOCTYPE" @keyword) - -(doctypedecl (Name) @type) - -;; Tags - -(STag (Name) @tag) - -(ETag (Name) @tag) - -(EmptyElemTag (Name) @tag) - -;; Attributes - -(Attribute (Name) @property) - -(Attribute (AttValue) @string) - -;; Delimiters & punctuation - -[ - "" - "" - "<" ">" - "" -] @punctuation.delimiter - -[ "(" ")" "[" "]" ] @punctuation.bracket - -[ "\"" "'" ] @punctuation.delimiter - -[ "," "|" "=" ] @operator - -;; Text - -(CharData) @markup - -(CDSect - (CDStart) @markup.heading - (CData) @markup.raw - "]]>" @markup.heading) - -;; Misc - -(Comment) @comment - -(ERROR) @error \ No newline at end of file diff --git a/languages/targets/indents.scm b/languages/targets/indents.scm deleted file mode 100644 index febed05..0000000 --- a/languages/targets/indents.scm +++ /dev/null @@ -1,2 +0,0 @@ -(STag ">" @end) @indent -(EmptyElemTag "/>" @end) @indent \ No newline at end of file diff --git a/languages/targets/outline.scm b/languages/targets/outline.scm deleted file mode 100644 index 601af71..0000000 --- a/languages/targets/outline.scm +++ /dev/null @@ -1,9 +0,0 @@ -(element - (STag - (Name) @name)) @item - -(EmptyElemTag - (Name) @name) @item - -(doctypedecl - (Name) @name) @item \ No newline at end of file From 1bdbd08ef9fd7ee34867b271bd5f5c666137c3e3 Mon Sep 17 00:00:00 2001 From: Sathiyaraman M Date: Fri, 5 Jun 2026 08:51:37 +0530 Subject: [PATCH 6/7] Convert csproj and slnx to use symlinks from msbuild --- languages/csproj/highlights.scm | 169 +------------------------------- languages/csproj/indents.scm | 3 +- languages/csproj/outline.scm | 10 +- languages/slnx/highlights.scm | 169 +------------------------------- languages/slnx/indents.scm | 3 +- languages/slnx/outline.scm | 10 +- 6 files changed, 6 insertions(+), 358 deletions(-) mode change 100644 => 120000 languages/csproj/highlights.scm mode change 100644 => 120000 languages/csproj/indents.scm mode change 100644 => 120000 languages/csproj/outline.scm mode change 100644 => 120000 languages/slnx/highlights.scm mode change 100644 => 120000 languages/slnx/indents.scm mode change 100644 => 120000 languages/slnx/outline.scm diff --git a/languages/csproj/highlights.scm b/languages/csproj/highlights.scm deleted file mode 100644 index c14be81..0000000 --- a/languages/csproj/highlights.scm +++ /dev/null @@ -1,168 +0,0 @@ -;; XML declaration - -"xml" @keyword - -[ "version" "encoding" "standalone" ] @property - -(EncName) @string.special - -(VersionNum) @number - -[ "yes" "no" ] @boolean - -;; Processing instructions - -(PI) @embedded - -(PI (PITarget) @keyword) - -;; Element declaration - -(elementdecl - "ELEMENT" @keyword - (Name) @tag) - -(contentspec - (_ (Name) @property)) - -"#PCDATA" @type.builtin - -[ "EMPTY" "ANY" ] @string.special.symbol - -[ "*" "?" "+" ] @operator - -;; Entity declaration - -(GEDecl - "ENTITY" @keyword - (Name) @constant) - -(GEDecl (EntityValue) @string) - -(NDataDecl - "NDATA" @keyword - (Name) @label) - -;; Parsed entity declaration - -(PEDecl - "ENTITY" @keyword - "%" @operator - (Name) @constant) - -(PEDecl (EntityValue) @string) - -;; Notation declaration - -(NotationDecl - "NOTATION" @keyword - (Name) @constant) - -(NotationDecl - (ExternalID - (SystemLiteral (URI) @string.special))) - -;; Attlist declaration - -(AttlistDecl - "ATTLIST" @keyword - (Name) @tag) - -(AttDef (Name) @property) - -(AttDef (Enumeration (Nmtoken) @string)) - -(DefaultDecl (AttValue) @string) - -[ - (StringType) - (TokenizedType) -] @type.builtin - -(NotationType "NOTATION" @type.builtin) - -[ - "#REQUIRED" - "#IMPLIED" - "#FIXED" -] @attribute - -;; Entities - -(EntityRef) @constant - -((EntityRef) @constant.builtin - (#any-of? @constant.builtin - "&" "<" ">" """ "'")) - -(CharRef) @constant - -(PEReference) @constant - -;; External references - -[ "PUBLIC" "SYSTEM" ] @keyword - -(PubidLiteral) @string.special - -(SystemLiteral (URI) @markup.link) - -;; Processing instructions - -(XmlModelPI "xml-model" @keyword) - -(StyleSheetPI "xml-stylesheet" @keyword) - -(PseudoAtt (Name) @property) - -(PseudoAtt (PseudoAttValue) @string) - -;; Doctype declaration - -(doctypedecl "DOCTYPE" @keyword) - -(doctypedecl (Name) @type) - -;; Tags - -(STag (Name) @tag) - -(ETag (Name) @tag) - -(EmptyElemTag (Name) @tag) - -;; Attributes - -(Attribute (Name) @property) - -(Attribute (AttValue) @string) - -;; Delimiters & punctuation - -[ - "" - "" - "<" ">" - "" -] @punctuation.delimiter - -[ "(" ")" "[" "]" ] @punctuation.bracket - -[ "\"" "'" ] @punctuation.delimiter - -[ "," "|" "=" ] @operator - -;; Text - -(CharData) @markup - -(CDSect - (CDStart) @markup.heading - (CData) @markup.raw - "]]>" @markup.heading) - -;; Misc - -(Comment) @comment - -(ERROR) @error \ No newline at end of file diff --git a/languages/csproj/highlights.scm b/languages/csproj/highlights.scm new file mode 120000 index 0000000..2554c9f --- /dev/null +++ b/languages/csproj/highlights.scm @@ -0,0 +1 @@ +../msbuild/highlights.scm \ No newline at end of file diff --git a/languages/csproj/indents.scm b/languages/csproj/indents.scm deleted file mode 100644 index febed05..0000000 --- a/languages/csproj/indents.scm +++ /dev/null @@ -1,2 +0,0 @@ -(STag ">" @end) @indent -(EmptyElemTag "/>" @end) @indent \ No newline at end of file diff --git a/languages/csproj/indents.scm b/languages/csproj/indents.scm new file mode 120000 index 0000000..31137cb --- /dev/null +++ b/languages/csproj/indents.scm @@ -0,0 +1 @@ +../msbuild/indents.scm \ No newline at end of file diff --git a/languages/csproj/outline.scm b/languages/csproj/outline.scm deleted file mode 100644 index 601af71..0000000 --- a/languages/csproj/outline.scm +++ /dev/null @@ -1,9 +0,0 @@ -(element - (STag - (Name) @name)) @item - -(EmptyElemTag - (Name) @name) @item - -(doctypedecl - (Name) @name) @item \ No newline at end of file diff --git a/languages/csproj/outline.scm b/languages/csproj/outline.scm new file mode 120000 index 0000000..4a435ef --- /dev/null +++ b/languages/csproj/outline.scm @@ -0,0 +1 @@ +../msbuild/outline.scm \ No newline at end of file diff --git a/languages/slnx/highlights.scm b/languages/slnx/highlights.scm deleted file mode 100644 index c14be81..0000000 --- a/languages/slnx/highlights.scm +++ /dev/null @@ -1,168 +0,0 @@ -;; XML declaration - -"xml" @keyword - -[ "version" "encoding" "standalone" ] @property - -(EncName) @string.special - -(VersionNum) @number - -[ "yes" "no" ] @boolean - -;; Processing instructions - -(PI) @embedded - -(PI (PITarget) @keyword) - -;; Element declaration - -(elementdecl - "ELEMENT" @keyword - (Name) @tag) - -(contentspec - (_ (Name) @property)) - -"#PCDATA" @type.builtin - -[ "EMPTY" "ANY" ] @string.special.symbol - -[ "*" "?" "+" ] @operator - -;; Entity declaration - -(GEDecl - "ENTITY" @keyword - (Name) @constant) - -(GEDecl (EntityValue) @string) - -(NDataDecl - "NDATA" @keyword - (Name) @label) - -;; Parsed entity declaration - -(PEDecl - "ENTITY" @keyword - "%" @operator - (Name) @constant) - -(PEDecl (EntityValue) @string) - -;; Notation declaration - -(NotationDecl - "NOTATION" @keyword - (Name) @constant) - -(NotationDecl - (ExternalID - (SystemLiteral (URI) @string.special))) - -;; Attlist declaration - -(AttlistDecl - "ATTLIST" @keyword - (Name) @tag) - -(AttDef (Name) @property) - -(AttDef (Enumeration (Nmtoken) @string)) - -(DefaultDecl (AttValue) @string) - -[ - (StringType) - (TokenizedType) -] @type.builtin - -(NotationType "NOTATION" @type.builtin) - -[ - "#REQUIRED" - "#IMPLIED" - "#FIXED" -] @attribute - -;; Entities - -(EntityRef) @constant - -((EntityRef) @constant.builtin - (#any-of? @constant.builtin - "&" "<" ">" """ "'")) - -(CharRef) @constant - -(PEReference) @constant - -;; External references - -[ "PUBLIC" "SYSTEM" ] @keyword - -(PubidLiteral) @string.special - -(SystemLiteral (URI) @markup.link) - -;; Processing instructions - -(XmlModelPI "xml-model" @keyword) - -(StyleSheetPI "xml-stylesheet" @keyword) - -(PseudoAtt (Name) @property) - -(PseudoAtt (PseudoAttValue) @string) - -;; Doctype declaration - -(doctypedecl "DOCTYPE" @keyword) - -(doctypedecl (Name) @type) - -;; Tags - -(STag (Name) @tag) - -(ETag (Name) @tag) - -(EmptyElemTag (Name) @tag) - -;; Attributes - -(Attribute (Name) @property) - -(Attribute (AttValue) @string) - -;; Delimiters & punctuation - -[ - "" - "" - "<" ">" - "" -] @punctuation.delimiter - -[ "(" ")" "[" "]" ] @punctuation.bracket - -[ "\"" "'" ] @punctuation.delimiter - -[ "," "|" "=" ] @operator - -;; Text - -(CharData) @markup - -(CDSect - (CDStart) @markup.heading - (CData) @markup.raw - "]]>" @markup.heading) - -;; Misc - -(Comment) @comment - -(ERROR) @error \ No newline at end of file diff --git a/languages/slnx/highlights.scm b/languages/slnx/highlights.scm new file mode 120000 index 0000000..2554c9f --- /dev/null +++ b/languages/slnx/highlights.scm @@ -0,0 +1 @@ +../msbuild/highlights.scm \ No newline at end of file diff --git a/languages/slnx/indents.scm b/languages/slnx/indents.scm deleted file mode 100644 index febed05..0000000 --- a/languages/slnx/indents.scm +++ /dev/null @@ -1,2 +0,0 @@ -(STag ">" @end) @indent -(EmptyElemTag "/>" @end) @indent \ No newline at end of file diff --git a/languages/slnx/indents.scm b/languages/slnx/indents.scm new file mode 120000 index 0000000..31137cb --- /dev/null +++ b/languages/slnx/indents.scm @@ -0,0 +1 @@ +../msbuild/indents.scm \ No newline at end of file diff --git a/languages/slnx/outline.scm b/languages/slnx/outline.scm deleted file mode 100644 index 601af71..0000000 --- a/languages/slnx/outline.scm +++ /dev/null @@ -1,9 +0,0 @@ -(element - (STag - (Name) @name)) @item - -(EmptyElemTag - (Name) @name) @item - -(doctypedecl - (Name) @name) @item \ No newline at end of file diff --git a/languages/slnx/outline.scm b/languages/slnx/outline.scm new file mode 120000 index 0000000..4a435ef --- /dev/null +++ b/languages/slnx/outline.scm @@ -0,0 +1 @@ +../msbuild/outline.scm \ No newline at end of file From 3c7d8bf50346f270211afcd968b8b44501abed67 Mon Sep 17 00:00:00 2001 From: MrSubidubi Date: Fri, 12 Jun 2026 09:01:01 +0200 Subject: [PATCH 7/7] Format Query-files --- languages/msbuild/highlights.scm | 174 +++++++++++++++++++------------ languages/msbuild/indents.scm | 7 +- languages/msbuild/outline.scm | 2 +- 3 files changed, 112 insertions(+), 71 deletions(-) diff --git a/languages/msbuild/highlights.scm b/languages/msbuild/highlights.scm index c14be81..eb54327 100644 --- a/languages/msbuild/highlights.scm +++ b/languages/msbuild/highlights.scm @@ -1,85 +1,102 @@ -;; XML declaration - +; XML declaration "xml" @keyword -[ "version" "encoding" "standalone" ] @property +[ + "version" + "encoding" + "standalone" +] @property (EncName) @string.special (VersionNum) @number -[ "yes" "no" ] @boolean - -;; Processing instructions +[ + "yes" + "no" +] @boolean +; Processing instructions (PI) @embedded -(PI (PITarget) @keyword) - -;; Element declaration +(PI + (PITarget) @keyword) +; Element declaration (elementdecl "ELEMENT" @keyword (Name) @tag) (contentspec - (_ (Name) @property)) + (_ + (Name) @property)) "#PCDATA" @type.builtin -[ "EMPTY" "ANY" ] @string.special.symbol - -[ "*" "?" "+" ] @operator +[ + "EMPTY" + "ANY" +] @string.special.symbol -;; Entity declaration +[ + "*" + "?" + "+" +] @operator +; Entity declaration (GEDecl "ENTITY" @keyword (Name) @constant) -(GEDecl (EntityValue) @string) +(GEDecl + (EntityValue) @string) (NDataDecl "NDATA" @keyword (Name) @label) -;; Parsed entity declaration - +; Parsed entity declaration (PEDecl "ENTITY" @keyword "%" @operator (Name) @constant) -(PEDecl (EntityValue) @string) - -;; Notation declaration +(PEDecl + (EntityValue) @string) +; Notation declaration (NotationDecl "NOTATION" @keyword (Name) @constant) (NotationDecl (ExternalID - (SystemLiteral (URI) @string.special))) - -;; Attlist declaration + (SystemLiteral + (URI) @string.special))) +; Attlist declaration (AttlistDecl "ATTLIST" @keyword (Name) @tag) -(AttDef (Name) @property) +(AttDef + (Name) @property) -(AttDef (Enumeration (Nmtoken) @string)) +(AttDef + (Enumeration + (Nmtoken) @string)) -(DefaultDecl (AttValue) @string) +(DefaultDecl + (AttValue) @string) [ (StringType) (TokenizedType) ] @type.builtin -(NotationType "NOTATION" @type.builtin) +(NotationType + "NOTATION" @type.builtin) [ "#REQUIRED" @@ -87,73 +104,95 @@ "#FIXED" ] @attribute -;; Entities - +; Entities (EntityRef) @constant ((EntityRef) @constant.builtin - (#any-of? @constant.builtin - "&" "<" ">" """ "'")) + (#any-of? @constant.builtin "&" "<" ">" """ "'")) (CharRef) @constant (PEReference) @constant -;; External references - -[ "PUBLIC" "SYSTEM" ] @keyword +; External references +[ + "PUBLIC" + "SYSTEM" +] @keyword (PubidLiteral) @string.special -(SystemLiteral (URI) @markup.link) - -;; Processing instructions - -(XmlModelPI "xml-model" @keyword) - -(StyleSheetPI "xml-stylesheet" @keyword) +(SystemLiteral + (URI) @markup.link) -(PseudoAtt (Name) @property) +; Processing instructions +(XmlModelPI + "xml-model" @keyword) -(PseudoAtt (PseudoAttValue) @string) +(StyleSheetPI + "xml-stylesheet" @keyword) -;; Doctype declaration +(PseudoAtt + (Name) @property) -(doctypedecl "DOCTYPE" @keyword) +(PseudoAtt + (PseudoAttValue) @string) -(doctypedecl (Name) @type) +; Doctype declaration +(doctypedecl + "DOCTYPE" @keyword) -;; Tags +(doctypedecl + (Name) @type) -(STag (Name) @tag) - -(ETag (Name) @tag) - -(EmptyElemTag (Name) @tag) +; Tags +(STag + (Name) @tag) -;; Attributes +(ETag + (Name) @tag) -(Attribute (Name) @property) +(EmptyElemTag + (Name) @tag) -(Attribute (AttValue) @string) +; Attributes +(Attribute + (Name) @property) -;; Delimiters & punctuation +(Attribute + (AttValue) @string) +; Delimiters & punctuation [ - "" - "" - "<" ">" - "" + "" + "" + "<" + ">" + "" ] @punctuation.delimiter -[ "(" ")" "[" "]" ] @punctuation.bracket - -[ "\"" "'" ] @punctuation.delimiter +[ + "(" + ")" + "[" + "]" +] @punctuation.bracket -[ "," "|" "=" ] @operator +[ + "\"" + "'" +] @punctuation.delimiter -;; Text +[ + "," + "|" + "=" +] @operator +; Text (CharData) @markup (CDSect @@ -161,8 +200,7 @@ (CData) @markup.raw "]]>" @markup.heading) -;; Misc - +; Misc (Comment) @comment -(ERROR) @error \ No newline at end of file +(ERROR) @error diff --git a/languages/msbuild/indents.scm b/languages/msbuild/indents.scm index febed05..d249677 100644 --- a/languages/msbuild/indents.scm +++ b/languages/msbuild/indents.scm @@ -1,2 +1,5 @@ -(STag ">" @end) @indent -(EmptyElemTag "/>" @end) @indent \ No newline at end of file +(STag + ">" @end) @indent + +(EmptyElemTag + "/>" @end) @indent diff --git a/languages/msbuild/outline.scm b/languages/msbuild/outline.scm index 601af71..f5ab0bd 100644 --- a/languages/msbuild/outline.scm +++ b/languages/msbuild/outline.scm @@ -6,4 +6,4 @@ (Name) @name) @item (doctypedecl - (Name) @name) @item \ No newline at end of file + (Name) @name) @item