Skip to content

Commit

Permalink
Fix TreeSitter
Browse files Browse the repository at this point in the history
  • Loading branch information
RedCMD committed Feb 27, 2024
1 parent c5a2d93 commit c5c275a
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 456 deletions.
2 changes: 1 addition & 1 deletion out/DiagnosticCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const TreeSitter_1 = require("./TreeSitter");
const extension_1 = require("./extension");
async function initDiagnostics(context) {
// Oniguruma regex parser
const uri = vscode.Uri.joinPath(context.extensionUri, 'out/onig.wasm');
const uri = vscode.Uri.joinPath(context.extensionUri, 'node_modules', 'vscode-oniguruma', 'release', 'onig.wasm');
const wasm = await vscode.workspace.fs.readFile(uri);
const options = {
data: wasm,
Expand Down
2 changes: 1 addition & 1 deletion out/TreeSitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ async function initTreeSitter(context) {
? undefined
: {
locateFile() {
return vscode.Uri.joinPath(context.extensionUri, 'out', 'tree-sitter.wasm').toString(true);
return vscode.Uri.joinPath(context.extensionUri, 'node_modules', 'web-tree-sitter', 'tree-sitter.wasm').toString(true);
}
};
await Parser.init(moduleOptions); // Everything MUST wait until TreeSitter initializes
Expand Down
Binary file removed out/onig.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion out/tokenColorCustomizations.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ async function update(uri) {
// Workspace settings have higher priority than Global settings. But... Workspace settings don't work when there is no Workspace
const configurationTarget = vscode.workspace.name ? vscode.ConfigurationTarget.Workspace : vscode.ConfigurationTarget.Global;
const configurationValue = vscode.workspace.name ? 'workspaceValue' : 'globalValue';
if (uri) {
if (uri && uri.scheme != 'untitled') {
try {
const packageDocument = await vscode.workspace.openTextDocument(uri);
const packageParsed = await JSON.parse(packageDocument?.getText());
Expand Down
Binary file removed out/tree-sitter.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion out/web/extension.js

Large diffs are not rendered by default.

Loading

0 comments on commit c5c275a

Please sign in to comment.