Open arcanis opened 7 years ago
Looking at the latest changes, it doesn't look like anything changed with regard to decodeTokens. Can you give the first version where the exception occurs?
Yep I was looking at the blame and it seems to have been that way for quite a long time. Weird, I thought it wasn't required before .. :|
That being said, my point about the perf hit still stands, I think. Have I missed something? Is there a builtin way to decode tokens that doesn't require to decode every previous line? I looked at the Atom source code, and apparently the decode process is done manually, which might be why you've never experienced this issue before.
Oooooh I think I got it. There's an extra undocumented field called openScopeTags
inside the structure returned by first-mate.
It seems the last release added an extra parameter to pass to
decodeTokens
- without it, the decode process might fail with an error similar to this one:Btw, why is that? Is it to avoid the need to store the scopes' enter tags at the beginning of each tokenized line? Because unless I'm mistaken, it also means that one has to iterate over every previous line in order to know what are the scopes for any random line.