WIP adding tree-sitter and language bindings
This commit is contained in:
parent
41401f7257
commit
ec841445ed
21
package.json
21
package.json
@ -64,6 +64,7 @@
|
||||
"rxjs": "7.8.0",
|
||||
"socket.io": "4.8.1",
|
||||
"uuid": "11.1.0",
|
||||
"web-tree-sitter": "0.25.8",
|
||||
"zone.js": "0.15.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -82,6 +83,26 @@
|
||||
"karma-coverage": "2.2.0",
|
||||
"karma-jasmine": "5.1.0",
|
||||
"karma-jasmine-html-reporter": "2.1.0",
|
||||
"tree-sitter": "0.21.1",
|
||||
"tree-sitter-bash": "0.23.2",
|
||||
"tree-sitter-c": "0.23.1",
|
||||
"tree-sitter-cli": "0.25.8",
|
||||
"tree-sitter-cpp": "0.23.4",
|
||||
"tree-sitter-css": "0.23.0",
|
||||
"tree-sitter-go": "0.23.4",
|
||||
"tree-sitter-html": "0.23.2",
|
||||
"tree-sitter-java": "0.23.5",
|
||||
"tree-sitter-javascript": "0.23.1",
|
||||
"tree-sitter-json": "0.24.8",
|
||||
"tree-sitter-lua": "2.1.3",
|
||||
"tree-sitter-php": "0.23.12",
|
||||
"tree-sitter-python": "0.23.2",
|
||||
"tree-sitter-r": "0.0.1-security",
|
||||
"tree-sitter-sql": "0.1.0",
|
||||
"tree-sitter-sqlite": "0.0.1-security",
|
||||
"tree-sitter-toml": "0.5.1",
|
||||
"tree-sitter-typescript": "0.23.2",
|
||||
"tree-sitter-yaml": "0.5.0",
|
||||
"tslib": "2.3.0",
|
||||
"typescript": "5.7.2"
|
||||
}
|
||||
|
BIN
public/wasm/tree-sitter-bash.wasm
Normal file
BIN
public/wasm/tree-sitter-bash.wasm
Normal file
Binary file not shown.
BIN
public/wasm/tree-sitter-c.wasm
Normal file
BIN
public/wasm/tree-sitter-c.wasm
Normal file
Binary file not shown.
BIN
public/wasm/tree-sitter-cpp.wasm
Normal file
BIN
public/wasm/tree-sitter-cpp.wasm
Normal file
Binary file not shown.
BIN
public/wasm/tree-sitter-css.wasm
Normal file
BIN
public/wasm/tree-sitter-css.wasm
Normal file
Binary file not shown.
BIN
public/wasm/tree-sitter-go.wasm
Normal file
BIN
public/wasm/tree-sitter-go.wasm
Normal file
Binary file not shown.
BIN
public/wasm/tree-sitter-html.wasm
Normal file
BIN
public/wasm/tree-sitter-html.wasm
Normal file
Binary file not shown.
BIN
public/wasm/tree-sitter-java.wasm
Normal file
BIN
public/wasm/tree-sitter-java.wasm
Normal file
Binary file not shown.
BIN
public/wasm/tree-sitter-javascript.wasm
Normal file
BIN
public/wasm/tree-sitter-javascript.wasm
Normal file
Binary file not shown.
BIN
public/wasm/tree-sitter-json.wasm
Normal file
BIN
public/wasm/tree-sitter-json.wasm
Normal file
Binary file not shown.
BIN
public/wasm/tree-sitter-php.wasm
Normal file
BIN
public/wasm/tree-sitter-php.wasm
Normal file
Binary file not shown.
BIN
public/wasm/tree-sitter-python.wasm
Normal file
BIN
public/wasm/tree-sitter-python.wasm
Normal file
Binary file not shown.
BIN
public/wasm/tree-sitter-typescript.wasm
Normal file
BIN
public/wasm/tree-sitter-typescript.wasm
Normal file
Binary file not shown.
@ -17,6 +17,9 @@ import "ace-builds/src-min-noconflict/ext-language_tools";
|
||||
// import "ace-builds/src-min-noconflict/theme-penguins_in_space";
|
||||
import "ace-builds/src-min-noconflict/theme-gruvbox";
|
||||
|
||||
// https://www.npmjs.com/package/web-tree-sitter
|
||||
// import { Language, Parser } from 'web-tree-sitter';
|
||||
|
||||
import { CodeViewBase } from './view.base';
|
||||
|
||||
import { NewtonFile } from '../../common/types/file.type';
|
||||
@ -42,6 +45,20 @@ export class CodeViewComponent extends CodeViewBase {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
// const { Parser } = window.TreeSitter;
|
||||
// const { Parser } = TreeSitter;
|
||||
// console.log(treeSitter);
|
||||
|
||||
// treeSitter.Parser.init().then(() => {
|
||||
// console.log("Parser ready...");
|
||||
// });
|
||||
|
||||
// const parser = new Parser();
|
||||
// const JavaScript = await Language.load('/path/to/tree-sitter-javascript.wasm');
|
||||
// Language.load('resources/wasm/tree-sitter-javascript.wasm').then((language) => {
|
||||
// console.log(language);
|
||||
// });
|
||||
|
||||
this.aceApi = ace;
|
||||
}
|
||||
|
||||
|
3978
src/libs/tree-sitter.js
Normal file
3978
src/libs/tree-sitter.js
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/libs/tree-sitter.wasm
Executable file
BIN
src/libs/tree-sitter.wasm
Executable file
Binary file not shown.
2
src/typings.d.ts
vendored
2
src/typings.d.ts
vendored
@ -1 +1 @@
|
||||
declare var showdown: any;
|
||||
declare var showdown: any;
|
||||
|
Loading…
Reference in New Issue
Block a user