clojure-lsp / clojure-lsp

Clojure & ClojureScript Language Server (LSP) implementation
https://clojure-lsp.io
MIT License
1.17k stars 153 forks source link

Quick typing leads to inaccurate completion suggestions #1425

Closed orestis closed 1 year ago

orestis commented 1 year ago

Describe the bug

Typing fast, in the context of creating a new local scope with restructuring (defn/let/etc.) results in giving misleading completions. Video shows the issue:

https://user-images.githubusercontent.com/9217/209626202-3692f19e-e267-44ae-9867-6ec5fa4f384f.mov

Link to Slack discussion: https://clojurians.slack.com/archives/CBE668G4R/p1670878025727979

To Reproduce Steps to reproduce the behavior:

Quickly type:

(defn foo [{:keys [bar baz]}]
  (let [v {:bar ba|}]) ; <- cursor here

Expected behavior

I would expect to be offered completions bar, baz.

Instead I see only :bar.

Screenshots If applicable, add screenshots to help explain your problem.

Log - client <-> server
ADD JSON HERE
Log - clojure-lsp
ADD HERE

User details (please complete the following information):

Additional context Add any other context about the problem here.

ericdallo commented 1 year ago

It should be fixed on master!

ericdallo commented 1 year ago

@orestis we changed the default behavior again on master giving the performance issue introduced, check here for more details.

To fix this issue you should add a setting :completion :analysis-type with the value of :slow-but-accurate

orestis commented 1 year ago

Personalised heads-up, love it! Thank you so much @ericdallo !