Skip to content

Commit 92822c1

Browse files
authored
Remove custom web-tree-sitter build and bump version (#94)
1 parent bccdce3 commit 92822c1

File tree

5 files changed

+6
-40
lines changed

5 files changed

+6
-40
lines changed

Makefile

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -46,27 +46,3 @@ parsers/tree-sitter-c-sharp.wasm: node_modules/tree-sitter-c-sharp/package.json
4646
mkdir -p $(dir $@)
4747
npx tree-sitter build --wasm $(dir $^)
4848
mv tree-sitter-c_sharp.wasm $@
49-
50-
51-
# Build web-tree-sitter
52-
53-
WEB_TREE_SITTER_FILES := README.md package.json tree-sitter-web.d.ts tree-sitter.js tree-sitter.wasm
54-
WEB_TREE_SITTER_DIR := vendor/web-tree-sitter
55-
56-
MAKE_CACHE_DIR := .make-work
57-
58-
.PHONY: web-tree-sitter
59-
web-tree-sitter: $(addprefix $(WEB_TREE_SITTER_DIR)/,$(WEB_TREE_SITTER_FILES))
60-
61-
$(addprefix $(WEB_TREE_SITTER_DIR)/,$(WEB_TREE_SITTER_FILES)): tree-sitter-version
62-
@rm -rf $(MAKE_CACHE_DIR)/tree-sitter
63-
@TREE_SITTER_VERSION=$(shell cat tree-sitter-version) ;\
64-
mkdir -p $(MAKE_CACHE_DIR)/tree-sitter && \
65-
curl -L https://api.github.com/repos/tree-sitter/tree-sitter/tarball/$$TREE_SITTER_VERSION | \
66-
tar -xz -C $(MAKE_CACHE_DIR)/tree-sitter --strip-components=1
67-
@cd $(MAKE_CACHE_DIR)/tree-sitter && \
68-
./script/build-wasm
69-
@mkdir -p $(WEB_TREE_SITTER_DIR)
70-
@cp $(MAKE_CACHE_DIR)/tree-sitter/LICENSE $(WEB_TREE_SITTER_DIR)
71-
@cp $(addprefix $(MAKE_CACHE_DIR)/tree-sitter/lib/binding_web/,$(WEB_TREE_SITTER_FILES)) $(WEB_TREE_SITTER_DIR)
72-
@rm -rf $(MAKE_CACHE_DIR)/tree-sitter

README.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,6 @@ When working with WSL, the host vscode instance connects to a vscode server on t
5959
- If you're adding language support to `vscode-parse-tree`, you need to clone that as well, build it, and link it into the `vscode-server` extension folder: `ln -s ~/your/code/vscode-parse-tree ~/.vscode-server/extensions/parse-tree` for instance.
6060
- If you get errors about needing to install the `Remote-WSL` extension, you might need to manually delete the extension from the host side and try again.
6161

62-
### Updating `web-tree-sitter`
63-
64-
We build a custom version of `web-tree-sitter` to ensure that we can always use the latest version and fix any problems as they come up.
65-
To update `web-tree-sitter` update the contents of [./tree-sitter-version](./tree-sitter-version) to the latest commit sha of [tree-sitter](https://github.com/tree-sitter/tree-sitter/commits/master).
66-
67-
The script which builds our custom version is at the end of our [`Makefile`](./Makefile).
68-
6962
## Change Log
7063

7164
See [CHANGELOG.md](CHANGELOG.md).

package.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@
7777
"vscode:prepublish": "npm run compile",
7878
"compile": "tsc -p ./ && make parsers",
7979
"watch": "tsc -watch -p ./",
80-
"preinstall": "make web-tree-sitter",
8180
"test": "npm run compile && node ./out/test",
8281
"benchmark": "npm run compile && node ./out/benchmark",
8382
"debug": "npm run compile && node --nolazy --inspect-brk=9229 ./out/test",
@@ -139,9 +138,6 @@
139138
"dependencies": {
140139
"jsonc-parser": "^2.1.0",
141140
"tar": ">=4.4.2",
142-
"web-tree-sitter": "file:vendor/web-tree-sitter"
143-
},
144-
"bundledDependencies": [
145-
"web-tree-sitter"
146-
]
141+
"web-tree-sitter": "^0.24.6"
142+
}
147143
}

tree-sitter-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

yarn.lock

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2293,8 +2293,10 @@ wcwidth@^1.0.1:
22932293
dependencies:
22942294
defaults "^1.0.3"
22952295

2296-
"web-tree-sitter@file:vendor/web-tree-sitter":
2297-
version "0.22.6"
2296+
web-tree-sitter@^0.24.6:
2297+
version "0.24.6"
2298+
resolved "https://registry.yarnpkg.com/web-tree-sitter/-/web-tree-sitter-0.24.6.tgz#05d15f15ca506a2615b7a97b3abc5183923812f2"
2299+
integrity sha512-NVG40wwFerkvOSsrY2NE56nKpzwCpn8VT51gqZZaIfkBCMu+0JZLFVwJlZLPO01Ewfq3+Xg+NY4Bot5GD0L03g==
22982300

22992301
[email protected], which@^2.0.1, which@^2.0.2:
23002302
version "2.0.2"

0 commit comments

Comments
 (0)