Skip to content

Commit 6317e91

Browse files
committed
Switch to tree-sitter-xml
1 parent e235ab7 commit 6317e91

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# For generating .wasm files for parsers
22
# See https://www.npmjs.com/package/web-tree-sitter
3-
LANGUAGES = agda bash c c-sharp clojure cpp css elm elixir go haskell hcl html java javascript json julia kotlin latex lua markdown nix perl php python query ruby rust scala scss sparql swift talon tsx typescript yaml
3+
LANGUAGES = agda bash c c-sharp clojure cpp css elm elixir go haskell hcl html java javascript json julia kotlin latex lua markdown nix perl php python query ruby rust scala scss sparql swift talon tsx typescript xml yaml
44

55
# Build web-tree-sitter parsers for $(LANGUAGES)
66

@@ -32,6 +32,11 @@ parsers/tree-sitter-tsx.wasm: node_modules/tree-sitter-typescript/tsx/package.js
3232
npx tree-sitter build-wasm $(dir $^)
3333
mv $(notdir $@) $@
3434

35+
parsers/tree-sitter-xml.wasm: node_modules/tree-sitter-xml/tree-sitter-xml/package.json
36+
mkdir -p $(dir $@)
37+
npx tree-sitter build-wasm $(dir $^)
38+
mv $(notdir $@) $@
39+
3540
parsers/tree-sitter-c-sharp.wasm: node_modules/tree-sitter-c-sharp/package.json
3641
mkdir -p $(dir $@)
3742
npx tree-sitter build-wasm $(dir $^)

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
"tree-sitter-swift": "github:alex-pinkus/tree-sitter-swift#7e4ccc97a25315022a70b730085deccd5680a39b",
128128
"tree-sitter-talon": "github:wenkokke/tree-sitter-talon#dafc9fabf7acc1a46d51cce379cec00c07661aa7",
129129
"tree-sitter-typescript": "github:tree-sitter/tree-sitter-typescript#286e90c32060032225f636a573d0e999f7766c97",
130+
"tree-sitter-xml": "github:ObserverOfTime/tree-sitter-xml#dd7ef38c74d8430da729b4da815e4c40776e03bb",
130131
"tree-sitter-yaml": "^0.5.0",
131132
"typescript": "^4.5.5"
132133
},

src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const languages: {
5050
terraform: { module: "tree-sitter-hcl" },
5151
typescript: { module: "tree-sitter-typescript" },
5252
typescriptreact: { module: "tree-sitter-tsx" },
53-
xml: { module: "tree-sitter-html" },
53+
xml: { module: "tree-sitter-xml" },
5454
yaml: { module: "tree-sitter-yaml" },
5555
};
5656

yarn.lock

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1842,7 +1842,7 @@ [email protected]:
18421842
resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19"
18431843
integrity sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==
18441844

1845-
nan@^2.11.1, nan@^2.12.1, nan@^2.14.0, nan@^2.14.1, nan@^2.14.2, nan@^2.15.0, nan@^2.16.0, nan@^2.17.0:
1845+
nan@^2.11.1, nan@^2.12.1, nan@^2.14.0, nan@^2.14.1, nan@^2.14.2, nan@^2.15.0, nan@^2.16.0, nan@^2.17.0, nan@^2.18.0:
18461846
version "2.18.0"
18471847
resolved "https://registry.yarnpkg.com/nan/-/nan-2.18.0.tgz#26a6faae7ffbeb293a39660e88a76b82e30b7554"
18481848
integrity sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w==
@@ -2871,6 +2871,12 @@ tree-sitter-sparql@^0.1.0:
28712871
dependencies:
28722872
nan "^2.14.0"
28732873

2874+
"tree-sitter-xml@github:ObserverOfTime/tree-sitter-xml#dd7ef38c74d8430da729b4da815e4c40776e03bb":
2875+
version "0.2.0"
2876+
resolved "https://codeload.github.com/ObserverOfTime/tree-sitter-xml/tar.gz/dd7ef38c74d8430da729b4da815e4c40776e03bb"
2877+
dependencies:
2878+
nan "^2.18.0"
2879+
28742880
tree-sitter-yaml@^0.5.0:
28752881
version "0.5.0"
28762882
resolved "https://registry.yarnpkg.com/tree-sitter-yaml/-/tree-sitter-yaml-0.5.0.tgz#c617ba72837399d8105ec10cdb4c360e1ed76076"

0 commit comments

Comments
 (0)