This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-05-22
Channels
- # announcements (17)
- # beginners (11)
- # biff (5)
- # calva (22)
- # cider (30)
- # clj-kondo (33)
- # clj-on-windows (20)
- # clojure (59)
- # clojure-dev (25)
- # clojure-europe (31)
- # clojure-nl (1)
- # clojure-norway (13)
- # clojure-sweden (5)
- # clojure-uk (6)
- # clojurescript (5)
- # community-development (2)
- # cursive (4)
- # datahike (5)
- # datalevin (7)
- # datomic (11)
- # emacs (8)
- # events (1)
- # gratitude (1)
- # hoplon (5)
- # hyperfiddle (1)
- # lsp (59)
- # matrix (11)
- # polylith (14)
- # portal (3)
- # practicalli (1)
- # rdf (2)
- # reitit (9)
- # releases (3)
- # rum (5)
- # yamlscript (6)
has anyone seen (error lsp-execute-command is already defined as something else than a generic function)
?
mm maybe related to https://github.com/d12frosted/homebrew-emacs-plus/issues/554 then
I had this problem as well, and that setnev trick worked I think
but I can try to clean the eln-cache again
yeah no still happening, so probably it's just because of that then
⛔ Error (use-package): fancy-narrow/:catch: Native compiler error: (lambda (&optional) (let ((f #'point-min)) (funcall f))), "Compiling /Users/andrea/.emacs.d/eln-cache/29.3-7b39e62b/subr--trampoline-706f696e742d6d696e_point_min_0.eln...
ld: library 'emutls_w' not found
libgccjit.so: error: error invoking gcc driver
Internal native compiler error: \"failed to compile\", \"/Users/andrea/.emacs.d/eln-cache/29.3-7b39e62b/subr--trampoline-706f696e742d6d696e_point_min_0.eln\", \"error invoking gcc driver\"
funnily enough I switch to emacs-plus@30 which fixed some other issues with LSP. The LSP problems were solved but I had other problems with v30 so I switched back to 29 and now it seems broken entirely 😕
We've just added this to our clj-kondo/config.edn, and it's stopped clojure-lsp from working properly 😄 :
:ns-groups [{:filename-pattern "test/.*" :name test-group}]
it works OK with :pattern "..." :name ...
variants though.
I can't see an open issue about this, nor an obvious cause in the code.Trying to work on this locally, but my jar build of the cli just keeps running out of heap space... Is there a guide anywhere to developing clojure-lsp locally?
I can't see how this could be a clojure-lsp issue :thinking_face:, maybe it's a clj-kondo issue but it needs speicfic args that clojure-lsp passes to it
My only thought so far is that filename is being passed as nil
, and that's causing a (silent?) exception.
I tried that, but got a compile error: No single method: _warn of interface: clojure_lsp.logger.ILogger found for function: -warn of protocol: ILogger
are you sure you are doing like https://github.com/clojure-lsp/clojure-lsp/blob/8ac7b42f6e4e8afb34bb7b669891f96a38653cb0/lib/src/clojure_lsp/parser.clj#L106?
I'm guessing the point at which kondo-config-for-ns
is called isn't appropriate to log?
But, this diff "fixes" the problem:
diff --git a/lib/src/clojure_lsp/feature/diagnostics.clj b/lib/src/clojure_lsp/feature/diagnostics.clj
index dc9033f7..8e8d6268 100644
--- a/lib/src/clojure_lsp/feature/diagnostics.clj
+++ b/lib/src/clojure_lsp/feature/diagnostics.clj
@@ -33,7 +33,7 @@
#{:deprecated-var})
(defn ^:private kondo-config-for-ns [kondo-config ns-name filename]
- (let [ns-groups (cons ns-name (kondo.config/ns-groups kondo-config ns-name filename))
+ (let [ns-groups (cons ns-name (kondo.config/ns-groups kondo-config ns-name (or filename "")))
configs-in-ns (seq (keep #(get (:config-in-ns kondo-config) %) ns-groups))
kondo-config (if configs-in-ns
(apply kondo.config/merge-config! kondo-config configs-in-ns)
Hmm, but warn
itself: https://github.com/clojure-lsp/clojure-lsp/blob/0ac5e4965bf59426c44bbcec5d3f65ba59e2b81d/lib/src/clojure_lsp/logger.clj#L30
And this invocation later in the same file: https://github.com/clojure-lsp/clojure-lsp/blob/0ac5e4965bf59426c44bbcec5d3f65ba59e2b81d/lib/src/clojure_lsp/feature/diagnostics.clj#L128
Next question, where do those logs go? My attempts at getting a printout using
❯ /Users/dominicmonroe/src/github.com/clojure-lsp/clojure-lsp/clojure-lsp --log-path lsp.out references --from some.util/cond+
Haven't worked, lsp.out
doesn't exist.I'm a bit confused by that, because presumably these are references from the kondo analysis, which I would assume have a :filename @U04V15CAJ?
Ha, https://github.com/clojure-lsp/clojure-lsp/blob/0ac5e4965bf59426c44bbcec5d3f65ba59e2b81d/lib/src/clojure_lsp/kondo.clj#L199-L203 OK 🙂 That's why
yeah, ideally clj-kondo would return URI for everything, but it returns filename, so we convert at lsp side
I guess when passing this into kondo then it should actually be (-> element :filename shared/uri->filename)
?
Cool! Is it desirable to have the project root passed in somehow so it's relative like kondo would usually be? Though all the examples for :filename-pattern
do lead with .*
presumably to offset that different things happen at different times.