Skip to content

feature: stable keyword highlighting during incomplete blocks #71

@m0n99

Description

@m0n99

Did you check the tree-sitter docs?

Is your feature request related to a problem? Please describe.

While typing, keywords only highlight when the parser has a complete block. I checked highlights.scm and saw that keywords like function/if/for/while/... are only captured inside their block nodes. During edits, this makes keyword colors flicker a lot when the block is incomplete.

Image Image

Describe the solution you'd like

Provide a fallback keyword highlight (literal keyword captures) so keywords stay highlighted even when the parse is incomplete. This would reduce flicker while editing without changing the grammar.

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions