Fork me on GitHub
#lsp
<
2021-10-26
>
andrea.crotti09:10:09

stupid question, but why does formatting require running the clj-kondo analysis?

ericdallo12:10:26

We actually need to analysis to know what namespaces are from your project

ericdallo12:10:03

We could make format just check all cljc files in folders but I think would be a adhoc approach different how almost everything on clojure-lsp works

andrea.crotti09:10:41

I would have thought that formatting is a context-free operation let's say, it could even just know about a single namespace and reformat it

andrea.crotti09:10:47

I've done a big round of reformatting on all our projects, and would like to just say to run that before commiting or something, but given how long it takes that's not really feasible

Karol Wójcik09:10:27

@ericdallo LSP seems to incorrectly show the following documentation:

(defn wrap-hl-req-res-model
  "Middleware that converts Ring Request/Response model to Holy Lambda (AWS Lambda) Request/Response model.
   Ideal for running regular ring applications on AWS Lambda.

   Middleware supports both `sync/async` ring handlers.

   **Example**

   
clojure (ns core (:require [fierycod.holy-lambda-ring-adapter.core :as hlra] [fierycod.holy-lambda.core :as h]) (defn ring-handler [request] {:status 200 :headers {} :body \"Hello World\"} (def HttpApiProxyGateway (hlra/wrap-hl-req-res-model ring-handler)) (h/entrypoint [#'HttpApiProxyGateway])
"
  [handler]
  (fn
    ([request]
     (ring-response->hl-response (handler (hl-request->ring-request!! request))))
    ([request respond raise]
     (handler (hl-request->ring-request!! request)
              (fn [response] (respond (ring-response->hl-response response)))
              raise))))

ericdallo12:10:14

That's odd, what's the namespace you are trying + project so I can give a try?

Karol Wójcik17:10:40

Here is the repro 🙂

ericdallo17:10:09

Thanks, I'll take a look later today

ericdallo23:10:52

I can't repro that, where exactly are you calling the docs command? what line and column exactly?

ericdallo23:10:44

Cool dracula theme BTW 😛

Karol Wójcik04:10:35

You can repro that. See ns :d

Karol Wójcik04:10:14

And ring response :D

Karol Wójcik08:10:57

Only dracula btw <3

ericdallo13:10:39

oh, got it, you mean the code block has no \n , is that right?

ericdallo13:10:21

this seems like a lsp-ui bug since showing the docs via eldocs with doom works perfectly for me (`K`)

ericdallo13:10:44

feel free to open an issue on lsp-ui , it's probably related with the way it renders markdown on the popup

Karol Wójcik13:10:52

Ohh. Sure. I will