This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-05
Channels
- # announcements (8)
- # asami (70)
- # babashka (28)
- # beginners (163)
- # calva (7)
- # cider (15)
- # clj-kondo (47)
- # cljs-dev (45)
- # clojars (2)
- # clojure (56)
- # clojure-europe (24)
- # clojure-italy (1)
- # clojure-losangeles (2)
- # clojure-nl (4)
- # clojure-spec (2)
- # clojure-uk (53)
- # clojurescript (46)
- # data-oriented-programming (15)
- # data-science (10)
- # datahike (2)
- # defnpodcast (1)
- # depstar (27)
- # emacs (35)
- # figwheel-main (28)
- # fulcro (38)
- # girouette (1)
- # graphql (16)
- # jobs-discuss (3)
- # kaocha (9)
- # keechma (2)
- # leiningen (6)
- # lsp (87)
- # malli (19)
- # membrane (16)
- # pathom (4)
- # re-frame (11)
- # shadow-cljs (25)
- # spacemacs (2)
- # testing (12)
- # tools-deps (14)
- # tree-sitter (4)
- # xtdb (20)
Is there an LSP UI equivalent of the flycheck mode line display of errors/warnings. I'm using doom-gruvbox theme and if I have clj-kondo install as a binary on the OS execution path, then I get the flycheck mode line display of errors and warnings. If I remove clj-kondo binary, LSP package includes clj-kondo if not on the command line, but I don't see a visual on the mode-line about errors/warnings
@U05254DQM FWIW I'm still using clj-kondo flycheck and have disabled lsp diagnostics, but this is because I'm also developing clj-kondo
That sounds an interesting approach. I use lsp mainly for seeing references for functions when doing archaeology on a code base. I 'need' flycheck to remind me not to commit things that clj-kondo will fail in the GitHub Action π
FYI We now have custom clijure-lsp linters like unused public vars, disabling diagnostics will remove these too.
There is a built-in feature on lsp-mode that show the errors/warnings on the modeline, I think it is lsp-modeline-diagnostics-enable
or something
No, this is a lsp-mode setting, not sure it makes sense to to add this kind of logic to the server
Also, not sure you could have both lsp and clj-kondo flycheck enable at the same time
Why is it not possible to say at the server side: filter these diagnostics for me, before sending them over to the client.
It's possible, I just not sure it's good to add this kind of logic, I imagine users complaining about wrong linters but not using lsp linter or something
This would also make it possible to not depend on any client side emacs config, but this would solve it for all clients
I think it would make sense to push more logic to the server than leave it on the client side
and I would like to opt in to the add-on linters that lsp provides based on the project-wide analysis
@ericdallo To be honest, I think the lens-mode is sufficient for me for showing unused vars
Ok, I'll release the new feature without this, we can see if that flag would be really necessary then
I'm seeing a weird issue. I'm running a local version of clojure-lsp. When I am attaching a client to the clojure-lsp source itself, everything works fine. When I attach to my work project, I see that the clojure LSP process has started, but no LSP server logs. In the client logs, I see a ton of: "stderr" "Syntax error reading source at (REPL:1:16).\nInvalid token: Content-Length:\n"
and similar looking things.
It seems like neovim is sending the correct handshake to clojure-lsp but for some reason it's interpreted wrong? I'm not sure why it works though with clojure-lsp's source code and with the work project.
@devn @ericdallo About automatically inferring deps from a random script: https://github.com/babashka/babashka/issues/733#issuecomment-791314599
We could use that I think, but we still don't know if the file is a bb one, so your idea is to have a flag that if enable we always use deps infer?
Yeah, from LSP it doesn't matter if this is a bb script, or other script, as long as it comes up with the correct list of deps
The same approach could also work for people who make use of add-lib (dynamically adding libs to the classpath)
I see, do you know if that works for lein projects, deps edn, shadow-cljs and etc? I wonder if we could replace all that logic with just deps infer in the future
I don't know also if I'd need to call deps infer in a specific file on a whole project to get the correct classpath
@ericdallo The idea of deps-infer is that it is agnostic about your project tools, it only looks at source
So you can infer deps from code that doesn't have a deps.edn, project.clj, etc, that is the idea
Got it, but what happens if I call it in a specific file of a deps.edn project? It'll bring me all the dependencies of that file only or the correct deps.edn deps?
I see, so we would't be able to replace all clojure-lsp logic to only use deps infer
Maybe this can be first used to update your existing deps.edn or to create one which lsp can then pick up on
Released https://github.com/clojure-lsp/clojure-lsp/releases/tag/2021.03.05-13.35.47 π
β’ Fix clojure-lsp lint crash when analyzing specific macros with clj-kondo hooks.
β’ Fix didChange
for Neovim client - thanks to @orestis
β’ Add new clojure-lsp linter: unused-public-var
- FixesΒ https://github.com/clojure-lsp/clojure-lsp/issues/359
β’ Add option to disable clj-kondo linter, check https://clojure-lsp.github.io/clojure-lsp/settings/#unused-public-var for more details.
I've seen another instance of neovim asking something that clojure-lsp can't deliver, something about watching workspace files? I'll investigate more and report back next week.
I mean, neovim is asking clojure-lsp to do something and clojure-lsp reports back that it lacks the capability.
Things seem to work without it, apparently, so perhaps neovim can also do client-side watching?
Seems like the NeoVim lsp client isn't as mature as I hoped. Still works but quite a lot of capabilities missing...
What do you use on vim @U11EL3P9U?
@ericdallo Are config in ~/.lsp
and the project .lsp
merged? I.e. can I set that linter config my home dir while overriding it in my project?
Excellent. So to have flycheck clj-kondo work with lsp I have:
{:auto-add-ns-to-new-files? false
:linters {:clj-kondo {:level :off}
:unused-public-var {:level :info}}}
in ~.lsp/config.edn
and:
(dolist (checker '(clj-kondo-clj clj-kondo-cljs clj-kondo-cljc clj-kondo-edn))
(setq flycheck-checkers (cons checker (delq checker flycheck-checkers))))
;; clj-kondo calls lsp after linting, even if there are errors
(dolist (checkers '((clj-kondo-clj . lsp)
(clj-kondo-cljs . lsp)
(clj-kondo-cljc . lsp)
(clj-kondo-edn . lsp)))
(flycheck-add-next-checker (car checkers) (cons 'error (cdr checkers))))
in my init.el (after loading flycheck-clj-kondo and lsp-mode)We reached 200 people on this channel π
thanks @U051L6Y6D you can claim you prize installing https://clojure-lsp.github.io/clojure-lsp/installation/ π