Fork me on GitHub

Something is borked with my doom-emacs/lsp setup and I'm trying to figure out what. On a brand new demo project, I'm seeing this weird situation where lsp does not seem to update (shows old errors, won't find correct references) if I change something in the file and save. But if I run lsp-workspace-restart it shows the updates (until, of course I make any more changes in the file). Has anyone seen behavior like this before?


As an update - if it helps to ring any bells - it is enough to close and open the file again - and the lsp/kondo checkers will update. But they do not seem to react to on-save


I should release this week a fix for that, if it is indeed the same issue. Try for now disabling :async-custom-lint? on clojure-lsl settings


@UKFSJSM38 this has been driving me up the walls. thanks! :async-custom-lint? seems to fix it for now; will test more later


for anyone following along, more precisely:

:linters {:clj-kondo {:async-custom-lint? false}}


I'd suggest just to rollback that setting after next release as this setting improve lint speed

👍 2

I'm exploring the Google Closure library with cljs and am curious about autocompletion and docs for it.


When importing in a namespace like (:require [goog.dom :as gdom]) I do not get any assistance on things which I know is kind of crutch but also could be quite helpful as we get this whole library for free (I think it is included by default right, no needed dependency).


Also, I'm thinking it might be quite difficult to get lsp support for using js interop method calls like (.querySelector js/document "body") because the method call is coming first right but if using the closure library we would be able to get such help because they would be function calls like (gdom/createElement "h1") instead.


I'm pretty naive on such matters but I'm curious on the process for adding a new library to the lsp autocomplete/docs capability


yeah, clojure-lsp for sure doesn't support that yet unfortunately, please create a issue


Will do! I was actually heading over to #clojurescript to see if it's common practice to use that library a lot. I would hate to ask other to do work I'm not capable of to only find out I'm the only one wanting it. haha


no problem, I'm not a heavy cljs developer so probably I'm missing something on clojure-lsp side, please add the maximum details about how that should work. About the (.querySelector js/document "body") , I think that would be hard to support since we depend on clj-kondo analysis for that, we don't even have java analysis for that yet, I think the same for js


Yeah I can't see how it would offer autocompletion because how would it know ahead of time what I'm calling the method on but maybe there is a way for it to analyze after the fact once it sees the completed expression and can parse it into (js/document.querySelector ...) or whatever to then be able to figure out what docs I'm asking for.


@U9J50BY4C you might have more luck with a runtime completion library


you can use CIDER and lsp side by side


Ahh ok, I will look into that. I use conjure which uses cider/nrepl alongside the lsp for autocompletion/docs too if I'm not mistaken so don't think it's available for some of these cljs things