Fork me on GitHub
#lsp
<
2022-09-05
>
andrea.crotti09:09:32

lsp warns me about unused namespaced keywords in a project while I'm on a certain namespace, which is quite nice. Is there a way to just see them all? carve would be a good candidate for that, but either that or clj-kondo itself don't seem to report them.

ericdallo12:09:21

What editor do you use?

ericdallo12:09:43

if Emacs with lsp-mode, there is lsp-treemacs-error-list

andrea.crotti12:09:13

ah nice that's good but I'd just like to run it from the cli

andrea.crotti12:09:21

so it can run in CI

ericdallo12:09:12

you can run clojure-lsp diagnostics

andrea.crotti12:09:07

ah cool thanks

ericdallo12:09:42

We use at nubank's CI, it's pretty useful, you could use lein-clojure-lsp as well if using a lein project

andrea.crotti12:09:03

does it find more stuff than clj-kondo?

andrea.crotti12:09:23

you would still use both I guess?

ericdallo12:09:10

Yep, there is clj-depend integration + unused-public-var linter, also you could use clojure-lsp clean-ns and format

ericdallo12:09:12

all in a single tool

andrea.crotti12:09:56

cool, we have carve and clj-kondo atm

andrea.crotti12:09:20

maybe I can drop carve if this is as configurable

andrea.crotti12:09:32

I'll see what it returns anyway

ericdallo12:09:27

it support all configurations from clj-kondo and all those integrations are pretty configurable as well, LMK if need any help or if there is anything missing on documentation

andrea.crotti12:09:45

interestingly redirecting the output of clojure-lsp diagnostics to file I got a file that kind of crashed Emacs facepalm

andrea.crotti12:09:55

only 251 lines and not very long lines, weird

andrea.crotti12:09:01

maybe the color escaping thing

andrea.crotti12:09:41

ah all the analyzing project files also went to stdout

ericdallo13:09:58

there is a --raw flag IIRC