Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing tree-sitter-wasms-roo #1081

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion esbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const copyWasmFiles = {
fs.copyFileSync(path.join(sourceDir, "tree-sitter.wasm"), path.join(targetDir, "tree-sitter.wasm"))

// Copy language-specific WASM files
const languageWasmDir = path.join(__dirname, "node_modules", "tree-sitter-wasms", "out")
const languageWasmDir = path.join(__dirname, "node_modules", "tree-sitter-wasms-roo", "out")
const languages = [
"typescript",
"tsx",
Expand Down
23 changes: 11 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,9 @@
"string-similarity": "^4.0.4",
"strip-ansi": "^7.1.0",
"tmp": "^0.2.3",
"tree-sitter-wasms": "^0.1.11",
"tree-sitter-wasms-roo": "0.1.13",
"turndown": "^7.2.0",
"web-tree-sitter": "^0.22.6",
"web-tree-sitter": "0.24.7",
"zod": "^3.23.8"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions src/services/tree-sitter/languageParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Using node bindings for tree-sitter is problematic in vscode extensions
because of incompatibility with electron. Going the .wasm route has the
advantage of not having to build for multiple architectures.

We use web-tree-sitter and tree-sitter-wasms which provides auto-updating prebuilt WASM binaries for tree-sitter's language parsers.
We use web-tree-sitter and tree-sitter-wasms-roo which provides auto-updating prebuilt WASM binaries for tree-sitter's language parsers.

This function loads WASM modules for relevant language parsers based on input files:
1. Extracts unique file extensions
Expand All @@ -53,7 +53,7 @@ This approach optimizes performance by loading only necessary parsers once for a
Sources:
- https://github.com/tree-sitter/node-tree-sitter/issues/169
- https://github.com/tree-sitter/node-tree-sitter/issues/168
- https://github.com/Gregoor/tree-sitter-wasms/blob/main/README.md
- https://github.com/bobqianic/tree-sitter-wasms-roo
- https://github.com/tree-sitter/tree-sitter/blob/master/lib/binding_web/README.md
- https://github.com/tree-sitter/tree-sitter/blob/master/lib/binding_web/test/query-test.js
*/
Expand Down
Loading