Skip to content

bpp-lsp: Improve adaptive debounce timing for processing changes #21

@rail5

Description

@rail5

The language server's handling of didChange notifications involves an adaptive debounce timing based on the average re-parse time for the current document. If parses are quick, we shorten our debounce time. If parses take a while, we lengthen our debounce time.

Potential improvements:

  1. Consider the user's typing speed as well. If edits are sparse, we can afford to shorten the debounce a bit more
  2. As it's written currently, the debounce time will never drop below 100ms. For very small files, this is excessive, and in many cases we ought to be able to drop as low as 20ms or 30ms without issue
  3. The current logic for calculating debounce timing is inlined in the didChange handler. It should be moved / better organized

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions