Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

decodeTokens is missing its 'scopes' arguments in the doc #89

@arcanis

Description

@arcanis

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:

Error: Expected popped scope to be meta.function.method.js, but it was undefined
    at GrammarRegistry.module.exports.GrammarRegistry.decodeTokens (/home/arcanis/cid/node_modules/first-mate/lib/grammar-registry.js:232:19)
    at Object.<anonymous> (/home/arcanis/cid/x.js:15:14)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:420:7)
    at startup (bootstrap_node.js:139:9)

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions