Skip to content

Editor completion lists nothing when typing fast: the request reaches the language server before the text #804

Closed

Description

@LeMyst

The recipe editor only suggests ingredients, cookware or units when you type slowly.

templates/edit.html sends the text to the language server 150 ms after the last keystroke (LSP_DEBOUNCE_MS, since 7343753). CodeMirror asks for completions as soon as typing pauses for 100 ms, and that request goes out right away. So when @sal is typed without a pause, the completion request reaches the server before the text containing @sal. The server completes against the text from before the @, finds no ingredient context, and the list stays empty. It only works when every keystroke waits longer than the debounce.

To reproduce: open a recipe whose name has no space (to steer clear of #802) that already uses @salt{}, start a new line, and type @sal quickly. No suggestions appear. Type it one letter at a time with pauses and salt is offered.

This affects every script and every trigger (@, #, ~, %).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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