Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

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

Open
ocoka opened this issue Aug 4, 2019 · 2 comments
Open

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

ocoka opened this issue Aug 4, 2019 · 2 comments

Comments

@ocoka
Copy link

ocoka commented Aug 4, 2019

Related to TypeStrong/atom-typescript#1503

@lierdakil
Copy link
Contributor

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
Copy link
Author

ocoka commented Aug 4, 2019

Thank's a lot

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants