Skip to content

[Request] __emitTokens to report relevance score #4392

Description

@3sGgpQ8H

Is your request related to a specific problem you're having?
I'm developing a syntax definition using __emitTokens API, and this API doesn't allow me to report relevance, so my syntax couldn't be autodetected.

The solution you'd prefer / feature you'd like to see added...
The emitter object or some other argument passed to __emitToken should expose a function for reporting relevance.

Any alternative solutions you considered...
I studied HLJS implementation trying to find some way to directly reach the relevance variable, but didn't find such a way.

Additional context...
Also, it would be great to permit __emitTokens at Mode level. In such a scenario __emitToken could consume input up to certain point, where the current mode should end, and return the index of that point, so the core engine knew where to proceed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions