question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make use of tree-sitter's incremental parsing

See original GitHub issue

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.

https://github.com/EvgeniyPeshkov/syntax-highlighter/blob/5cfdaf7f4c545d49417bb157b6ea73b16fa253b0/src/extension.ts#L200

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:4
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
Mencicommented, Mar 11, 2020

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 tree.edit and I didn’t find any issue with multi-line editing.

Maybe it’s a bug in tree-sitter and already be fixed? Or maybe it’s a vscode bug?

0reactions
milahucommented, Nov 24, 2021

Initially I utilized partial updates of syntax tree. But sometimes it broke highlighting after multi-line edits

could be fixed in tree-sitter 0.20.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tree-sitter|Introduction
Tree-sitter is a parser generator tool and an incremental parsing library. It can build a concrete syntax tree for a source file and...
Read more >
Introductory to Treesitter - Teknologi Umum
Tree-sitter is a parser generator tool and an incremental parsing library. It can build a concrete syntax tree for a source file and...
Read more >
Tree-sitter: an incremental parsing system for programming tools
The parsing is fast enough to run on every keystroke. The parse tree is extremely concise and readable. It resembles an AST more...
Read more >
fast Scala 3 parsing with tree-sitter - eed3si9n
Tree-sitter is a parser generator tool and an incremental parsing ... uses external scanners to scan string literals, which makes sense ...
Read more >
2020 - talks - Incremental Parsing with emacs-tree-sitter
Tree-sitter is a parser generator and an incremental parsing ... For the time being it looks like nvim-treesitter also uses the S-exp syntax ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found