Skip to content

Commit

Permalink
chore: upgrade to [email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
ikatyang committed Sep 23, 2020
1 parent e83e277 commit b26d567
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,13 @@ let tree;
}

async function handleCodeChange(editor, changes) {
const newText = codeEditor.getValue() + '\n';
const newText = codeEditor.getValue();
const edits = tree && changes && changes.map(treeEditForEditorChange);

const start = performance.now();
if (tree && changes) {
for (const change of changes) {
tree.edit(treeEditForEditorChange(change));
if (edits) {
for (const edit of edits) {
tree.edit(edit);
}
}
const newTree = parser.parse(newText, tree);
Expand Down

Large diffs are not rendered by default.

Binary file modified docs/assets/tree-sitter-yaml-0.1.0/tree-sitter-yaml.wasm
Binary file not shown.
1 change: 0 additions & 1 deletion docs/assets/web-tree-sitter-0.15.9/tree-sitter.js

This file was deleted.

Binary file removed docs/assets/web-tree-sitter-0.15.9/tree-sitter.wasm
Binary file not shown.
File renamed without changes.
1 change: 1 addition & 0 deletions docs/assets/web-tree-sitter-0.16.7/tree-sitter.js

Large diffs are not rendered by default.

Binary file not shown.
6 changes: 3 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="assets/tree-sitter-playground-0.15.9/style.css" media="screen" type="text/css">
<link rel="stylesheet" href="assets/tree-sitter-playground-0.16.7/style.css" media="screen" type="text/css">
<title>Tree-sitter YAML Playground</title>
</head>

Expand Down Expand Up @@ -62,10 +62,10 @@ <h4>Tree</h4>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.45.0/codemirror.min.js"></script>

<script>LANGUAGE_BASE_URL = "assets/tree-sitter-yaml-0.1.0";</script>
<script src="assets/web-tree-sitter-0.15.9/tree-sitter.js"></script>
<script src="assets/web-tree-sitter-0.16.7/tree-sitter.js"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/clusterize.js/0.18.0/clusterize.min.js"></script>
<script src="assets/tree-sitter-playground-0.15.9/playground.js"></script>
<script src="assets/tree-sitter-playground-0.16.7/playground.js"></script>

<script>
(codeExample => {
Expand Down
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
"release": "standard-version",
"tree-sitter": "./tree-sitter/target/release/tree-sitter"
},
"standard-version": {
"preset": "angular",
"scripts": {
"postbump": "rm -r docs && node scripts/generate-playground.js && git add docs"
}
},
"dependencies": {
"nan": "^2.14.0"
},
Expand Down

0 comments on commit b26d567

Please sign in to comment.