lsp

:clojure-lsp: Clojure implementation of the Language Server Protocol: https://clojure-lsp.io/
2021-05-04T13:42:05.162500Z

Hey folks. I’m using LSP with eglot in Emacs. Unless the point is not exactly at point, code actions don’t present the option to require ns. Is that expected? Does that depend on the client? I recall that lsp-mode offered the option for requiring ns regardless of the position of the point, as long as it was in the same line as the symbol that uses the missing ns.

ericdallo 2021-05-04T13:51:15.162600Z

https://github.com/clojure-lsp/clojure-lsp/blob/master/src/clojure_lsp/feature/code_actions.clj#L37and https://github.com/clojure-lsp/clojure-lsp/blob/master/src/clojure_lsp/feature/code_actions.clj#L177-L178 are the code where clojure-lsp use the range from the diagnostic to return the code action to the client, the client will send this :data field when user choose the code action, so I'm not sure the issue here is with the client since the server send the :data

ericdallo 2021-05-04T13:51:50.162900Z

basically, the data field is a generic field that server can return and when client choose a code action, it sends the same data

ericdallo 2021-05-04T13:52:18.163100Z

where you can see it's resolved/retrieved https://github.com/clojure-lsp/clojure-lsp/blob/master/src/clojure_lsp/feature/code_actions.clj#L87-L92