-
Notifications
You must be signed in to change notification settings - Fork 44
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
Make use of tree-sitter's incremental parsing #46
Comments
This tree-sitter extension works well on updating tree-sitter's tree: |
Hello @Menci, |
I'm currently working on porting your highlighter from vscode to monaco-editor, in order to have fancy highlights in the web. I built a demo here. I used Maybe it's a bug in tree-sitter and already be fixed? Or maybe it's a vscode bug? |
should be reported to tree-sitter ... may be a duplicate of tree-sitter/tree-sitter#1444
as a "less brutal" solution, i guess it should be possible to estimate the size of a changeset, as produced by monaco-editor edit:
seems the issue is not the size of the update, but syntax errors, → when user is editing, do a full parse every 5 seconds |
could be fixed in tree-sitter 0.20.1 |
Tree-sitter supports incremental parsing, which can be accessed via
tree.edit
. But {Syntax Highlighter} just parse the code and generate a new tree every time. This will lost the efficiency advantage from tree-sitter.Also, instad of rebuild every time,
buildDecor
should be done incrementally.syntax-highlighter/src/extension.ts
Line 200 in 5cfdaf7
The text was updated successfully, but these errors were encountered: