Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LSC is not always debouncing #349

Open
bluz71 opened this issue Oct 16, 2020 · 0 comments
Open

LSC is not always debouncing #349

bluz71 opened this issue Oct 16, 2020 · 0 comments

Comments

@bluz71
Copy link
Contributor

bluz71 commented Oct 16, 2020

Hello Nate,

I have journeyed down a debounce rabbit hole.

LSC does debounce, but not always. My query is about the times LSC does not appear to debounce whilst a user is typing content.

I have been experimenting with the Ruby language server, Solargraph, and this example Ruby sample file:

class FooBar
  def initialize
    @abc = "abc"
    @hello = "hello"
    @help = "help"
  end

  def baz
    <<INSERT-CONTENT-HERE>>
  end
end

foo = Foobar.new

I bumped up the LSC 500ms debounce timer to 2 seconds during my testing.

At the same time I setup Solargraph to real time log input and output events as noted in the LSC debug documentation.

At the above <<INSERT-CONTENT-HERE>> position if I type FooBarFooBarFooBarFooBarFooBar then LSC debounces textDocument/didChange requests. Noting that FooBar matches the class name in the buffer. Only one textDocument/didChange event is sent, and no textDocument/completion event (after the Foo prefix is sent, noting LSC by default waits until the third character).

If instead I type BarFooBarFooBarFooBarFooBarFoo then LSC sends a textDocument/didChange and textDocument/completion pairs after every character typed (from the third character onwards). Noting that Bar prefix does not match anything.

It seems if a three character prefix produces completion matches then debouncing happens for characters typed after the prefix. If the prefix does not produce completion matches then LSC sends a textDocument/didChange and textDocument/completion pair for every typed character after the prefix.

My expectation is that debouncing should occur in both instances.

Best regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant