This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-21
Channels
- # announcements (1)
- # babashka (13)
- # beginners (85)
- # calva (1)
- # chlorine-clover (16)
- # cider (30)
- # clj-kondo (2)
- # clj-on-windows (5)
- # cljdoc (3)
- # cljs-dev (12)
- # cljsrn (19)
- # clojure (88)
- # clojure-europe (39)
- # clojure-nl (7)
- # clojure-sweden (3)
- # clojure-uk (8)
- # clojurescript (35)
- # core-async (3)
- # data-science (2)
- # datomic (17)
- # defnpodcast (3)
- # deps-new (1)
- # editors (18)
- # emacs (4)
- # events (1)
- # expound (1)
- # figwheel-main (8)
- # fulcro (9)
- # graalvm (2)
- # graalvm-mobile (11)
- # helix (44)
- # jobs (7)
- # lsp (95)
- # luminus (9)
- # malli (6)
- # meander (4)
- # membrane (2)
- # missionary (13)
- # off-topic (98)
- # pathom (2)
- # polylith (4)
- # portal (3)
- # re-frame (6)
- # reagent (27)
- # reitit (3)
- # releases (3)
- # remote-jobs (6)
- # rewrite-clj (1)
- # rum (2)
- # sci (3)
- # shadow-cljs (7)
- # sql (66)
- # tools-deps (80)
- # vim (5)
- # xtdb (3)
Is it possible to use clj-kondo style ignore forms with lsp linters like so:
#_{:clj-lsp/ignore [:unused-public-var]}
(def some-api-var ...)
… I mean besides doing in config… I’d rather the ignore and code was in the same place
@donavan There is an open issue for this in clojure-lsp. We're going to implement #_:linter/ignore
on both sides so you can just use one annotation for both tools
@UKFSJSM38 what about trying to port this linter to clj-kondo and trying to support all linting in clj-kondo in the future? I'm open to this, but it may take some time
Yes, IMO that would be the best but not sure what is required on clj-kondo side for that, like know the project root, the source paths etc
What would be needed is
1) lint clj-kondo with a set of code of which you know that is the entire project, perhaps with a --project
flag or so
2) clj-kondo can then save a bucket of all public var usages or something
3) this bucket gets updated each time you lint a new file (or files) so the public var linter can read from this bucket each time and know it has a "whole project" knowledge of this
Made an issue here: https://github.com/clj-kondo/clj-kondo/issues/1321 I think it's about time that clj-kondo supported these project-wide linters
I'd love to open an PR, but not sure if that is too much for what I know how to code in clj-kondo 😂
clojure-lsp has a atom with all analysis, clojure-lsp just query for all var-definitions of that file that doesn't have a reference, each time a file is changed or something, it has not a bad performance, but certainly on clj-kondo would be way better
Awesome, sounds like you guys have this under control! Thanks both 🙂 … I’ll just use the global config for now.
how do i know which LSP spec version does clojure-lsp use?
There is no such official way, clojure-lsp implement most 3.16 important features already
i’m reading through the lsp4j code (which is wild, lol, i’m not a big fan of xtend), and am trying to follow how the signature help stuff works
thanks so much
> i’m not a big fan of xtend neither I hehe I needed to open PR adding support for call hierarchy there and it was not cool haha
In VSCode IDE, when I run the clean NS Form
command, it just sorts the namespace but it’s not removing the unused namespaces as shown here - https://clojure-lsp.github.io/clojure-lsp/features/#clean-namespace. Does it require any configurations from VSCode or is it an issue?
Not sure how Calva handle calls it c/c @U9A1RLFNV
oh, maybe you are calling it correctly, it is just not removing because of a wrong analyzed project?
maybe try remoing .lsp/sqlite.db
, restarting vscode and checking if shows as unused
no, linter is not showing that but if I find in a file there is no use of that namespace
it will not remove if the linter doesn't report any unused, so we need to fix that first
hmm, so I added [clojure.set :as sset]
which got a Unsorted namespace
linter error, and clean NS
sorted it but didn’t removed it
just to update, I have tried to reproduce it in a new project and it works as intended. So, it’s a problem with my work project settings, mostly clj-kondo
settings as it’s not highlighting unused namespaces. Will try to figure that out. Thanks for the quick response.
probably clojure-lsp is not being able to scan your project classpath via lein classpath
or clj -Spath
depending on your project
https://clojure-lsp.github.io/clojure-lsp/troubleshooting/#getting-server-log See here
Given this output from my lsp-log emacs buffer
Found the following clients for /home/drewverlee/tomatto/backend/deps.edn: (server-id clojure-lsp, priority 0)
The following clients were selected based on priority: (server-id clojure-lsp, priority 0)
Found the following clients for /home/drewverlee/tomatto/frontend/src/main/tomatto/frontend/app.cljs: (server-id clojure-lsp, priority 0)
The following clients were selected based on priority: (server-id clojure-lsp, priority 0)
I assume lsp mode is able to find the binary, can someone confirm my understanding?you can configure that manually with lsp-clojure-server-command '("bash" "-c" "/path/to/clojure-lsp/binary")
as well
what is the file hierarchy telling me here: https://emacs-lsp.github.io/lsp-mode/page/troubleshooting/
the log is what i posed above.
the tmp file, ok
2021-07-21T19:34:09.044Z drewverlee INFO [clojure-lsp.main:386] - Starting server... 2021-07-21T19:34:09.047Z drewverlee DEBUG [clojure-lsp.nrepl:24] - nrepl not found, skipping nrepl server start..
hmm i'm starting nrepl in the normal way, via cider-jack-in-cljs
i guess i hadn't started it yet.
roger
there is nothing else.
backing up, it's telling me that "the connected server(s) doesn't support renaming". If i try to "lsp-find usage" i get "the connected servers does not support method textDocument/defination. and prompts for lsp-describe-session which outputs... nothing in messages buffer at least. Or at the bottom of the screen. clojure-lsp from emacs gives :LSP :: lsp-mode <tel:202107151320|20210715.1320>, Emacs 27.2, gnu/linux I don't have clojure-lsp aliased so i can check on the command line. I forget how i installed it, i guess i'm currently thinking it was part of a spacmacs layer. Or it seems i probably ran "lsp-install-server" as that option doesn't list clojure so i assume its already insatlled?
➜ Personal lsp
zsh: command not found: lsp
LSP :: Connected to [clojure-lsp:155532/starting].
Not seeing it on the Clojure-LSP site, but is there a comment code/form/selection ability?
I don't use vim, but I bet there is some plugin or something else to manipulate those comments