Skip to content

Redundant work when checking large files #2237

Open
@matklad

Description

@matklad

This is the experience I get when I type something in TigerBeetle's replica.zig

output.mp4

Note how the red squiggly "chases" my cursor, because I can type faster than the time it takes to update the error.

The fact that update takes longer than typing is expected --- that's one large file.

What is problematic though, is the useless work. Because the squiggly moves character-by-character, it means that ZLS fully analyzes every intermediate state, but that's hugely wasteful. It should directly jump to the latest version, coalescing intermediate upgrades. That is, I expect that first there should be one-character wide squiggly, which than immediately jumps to cover the entire word.

Note that what is needed not debouncing, but just coalescing. That is, the analyze should kick in immediately after the user starts typing. However, when the analysis finishes, it should be restarted keeping all of the accumulated changes so far.

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