Skip to content

Using tree-sitter-highlight library from upstream #162

Answered by ubolonton
jspawar asked this question in Q&A
Discussion options

You must be logged in to vote

Was curious then why tree-sitter-highlight wasn't used instead? (Assuming it wasn't used because it's not in the Cargo.toml)

That library is designed for the use case of highlighting static sources, without handling edits. The underlying mechanism is the same: querying the syntax tree using a Lisp-like query language.

I also tried toying around with that upstream library and seems plenty sufficient (so far as I understand it is what's actually intended to back highlighting in the bigger consumers of tree-sitter such as Atom or GitHub itself).

GitHub's use case is the static highlighting mentioned above.
Atom doesn't use that library. Its highlighting mechanism is more ad-hoc, which pr…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jspawar
Comment options

Answer selected by ubolonton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Not a bug report or feature request
2 participants
Converted from issue

This discussion was converted from issue #156 on August 01, 2021 11:38.