Fork me on GitHub
#lsp
<
2022-09-23
>
skylize17:09:33

Found another one. Should I file a new issue @ericdallo? clojure-lsp version used: 2022.09.21-15.55.25-nightly (in Calva)

({:foo}) ;; πŸ’£
Cursor anywhere except after the entire form to throw exception. More details in thread.

skylize18:09:28

Same with any unbalanced map,

({:foo :bar :baz}) ;; πŸ’£
infinite nesting of any bracket type, provided the outermost pair is parentheses, and at least one pair is curly braces,
({{{{{{{{:foo}}}}}}}}) ;; πŸ’£
([(({[[[(:foo)]]]}))]) ;; πŸ’£
and any amount of whitespace, except while the cursor has whitespace to both sides,
({:foo|  }  )  ;; πŸ’£
({:foo  |}  )  ;; πŸ’£
({:foo | }  )  ;; πŸ‘ŒπŸ»
and with other expressions intermingled.
(fn [|] (foo :foo)) ;; πŸ‘ŒπŸ»
(fn [{|}] (foo :foo)) ;; πŸ‘ŒπŸ»
(fn [{:|}] (foo :foo)) ;; πŸ’£
(fn [{:k|}] (foo :foo)) ;; πŸ’£
(fn [{:ke|}] (foo :foo)) ;; πŸ’£
(fn [{:key|}] (foo :foo)) ;; πŸ’£
(fn [{:keys|}] (foo :foo)) ;; πŸ’£
(fn [{:keys |}] (foo :foo)) ;; πŸ’£
(fn [{:keys [|]}] (foo :foo)) ;; πŸ‘ŒπŸ» balanced now
Contents need not be resolvable, and in some cases might not even need to be valid.
({missing-ns/foo}) ;; πŸ’£
({/}) ;; πŸ’£

ericdallo18:09:02

Please post in the same, I think we should fix it in a generic way to avoid this in the future c/c @U07M2C8TT

skylize18:09:14

Updated with new case and request-response traces for both. https://github.com/clojure-lsp/clojure-lsp/issues/1268

ericdallo14:09:13

a little bit, we added custom code to clojure-lsp to handle some invalid codes like kondo does

skylize15:09:27

I was chatting with @UE21H2HHD a few days ago, that pointed to that issue. https://clojurians.slack.com/archives/CBE668G4R/p1663863858149529 Ended with request that I move discussion to #rewrite-clj (which I do intend to do). The problems in this thread are much more pervasive and tricky, and would significantly raise the importance of trying to find a meaningful fix.

ericdallo15:09:26

we've been hacking that on kondo and rewrite-clj, we should probably have that on rewrite behind some setting or flag

skylize17:09:29

@pez How do I get the Request/Response Log for clojure-lsp in Calva?

pez09:09:03

Generally: I've tried to populate the clojure-lsp statusbar item with the commands for showing the logs and control clojure-lsp.

skylize23:09:33

The back-and-forth between server and client is hidden behind a disabled setting, but specifically requested in the form for a new Issue.

pez14:09:18

This setting is a bit special in that it is half-built in to VS Code. But I could at least make it a bit easier to discover this way.