atom-haskell / atom-highlights

Minimal highlighting in Atom without atom-text-editor
1 stars 1 forks source link

Latest Atom grammar.tokenizeLines is not a function API changes #2

Open ocoka opened 5 years ago

ocoka commented 5 years ago

Related to TypeStrong/atom-typescript#1503

lierdakil commented 5 years ago

Should be kinda-fixed in v0.4.2.

This is due to tree-sitter grammars having a completely different interface. And actually lacking the interface to parse text directly. The "proper" fix would've been to detect the type of grammar and then either use tree-sitter or text-mate for highlighting, depending on the type of grammar. But in practice, highlighting using tree-sitter grammars is a mess: one ought to create a text editor, let it tokenize (and bear in mind tokenization is asynchronous), and then rip the underlying HTML representation using undocumented low-level API. While not impossible, I'm a bit reluctant to actually do that here, since it's actually rather brittle.

So, for now, tree-sitter grammars are simply ignored in favour of text-mate ones.

Let's keep this issue open, this might be worth revisiting at some point.

ocoka commented 5 years ago

Thank's a lot