Fork me on GitHub
#lsp
<
2022-01-02
>
pithyless10:01:04

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?

pithyless11:01:15

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

ericdallo14:01:45

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

pithyless14:01:52

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

pithyless14:01:32

for anyone following along, more precisely:

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

ericdallo14:01:47

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

👍 2
Chase15:01:56

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

Chase15:01:08

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).

Chase15:01:18

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.

Chase15:01:20

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

ericdallo15:01:57

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

Chase15:01:45

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

ericdallo15:01:19

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

Chase15:01:57

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.

borkdude15:01:43

@U9J50BY4C you might have more luck with a runtime completion library https://docs.cider.mx/cider/usage/code_completion.html

1
borkdude15:01:06

you can use CIDER and lsp side by side

Chase16:01:39

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