This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-06-28
Channels
- # announcements (5)
- # babashka (7)
- # beginners (46)
- # biff (28)
- # calva (7)
- # cider (3)
- # clerk (82)
- # clj-commons (9)
- # clj-kondo (7)
- # clojure (37)
- # clojure-dev (16)
- # clojure-europe (18)
- # clojure-norway (7)
- # clojurescript (8)
- # clojureverse-ops (3)
- # cursive (5)
- # datomic (4)
- # emacs (20)
- # exercism (2)
- # lsp (58)
- # off-topic (32)
- # polylith (11)
- # reitit (7)
- # tools-build (7)
- # xtdb (4)
Hi, how do I know where did clojure-lsp get the settings from? I’m assuming it prioritizes the project .lsp/config.edn
over other, but I’m not sure and wanted to check it
if using vscode or emacs you can request serverInfo
(in emacs lsp-clojure-server-info
), there it should print all settings used considering project, home etc
but https://clojure-lsp.io/settings/#project the waterfall that clojure-lsp does
Peter is right, when I stop clojure-lsp server, these stop happening. What’s causing them? Is something broken in my setup?
I think I triggered these by enabling the following vscode settings:
"editor.codeActionsOnSave": {
"source.organizeImports": true,
"source.fixAll": true
},
cc @U0ETXRFEW if this is going through calva
Hum, it's saying it's an error only because there is nothing to clear/import in the file like we do https://github.com/clojure-lsp/clojure-lsp/blob/b318465bec4932b9e05ab1f2d6535c64441c07d0/lib/src/clojure_lsp/feature/refactor.clj#L204-L207, but maybe we should not return an LSP error for clean-ns refactor

In some message/screenshot I saw it looked like it was Calva’s output window where the command failed. There is no namespace there. But also, iirc, we exclude that file from clojure-lsp support…
Feel free to open a issue in clojure-lsp about not returning an LSP error message if there is nothing to clear
I’m not sure I understand the situation enough to formulate a very good issue. Even if I have spent considerable amounts of hours trying to figure out a way to make Calva intercept and filter the messages, but there really seems to be no hook there for something like that. Usually when I think something can’t be done, @U9A1RLFNV shows me that it can, but with this not even he seems to see what we could do.
Peter, with those settings above, were you able to reproduce the issue?
Issue created here: https://github.com/clojure-lsp/clojure-lsp/issues/1603 @UHS6PHL31 Please add more details to the issue if you feel they would help.
@U9A1RLFNV, if you understand the issue well enough, maybe you can file the issue that @UKFSJSM38 asked about too? There’s a general layer to this symptom that Calva users would benefit from having addressed.
I added some details to the issue. I although feel that if that’s controlled by Calva, maybe it can be fixed in Calva?
> Yeah, I know what you filed. 😃 > @U9A1RLFNV, if you understand the issue well enough, maybe you can file the issue that @UKFSJSM38 asked about too? I don't know what you're referring to above, then :thinking_face:
I think there is a more general pattern here. We keep seeing errors pop up, that don’t seem like they should pop up.
Oh I see. Relation issues: • https://github.com/BetterThanTomorrow/calva/issues/2171 • https://github.com/BetterThanTomorrow/calva/issues/2165
From myself:
> We might be able to override vscode.window.showErrorMessage
and filter out clojure-lsp errors.
I'm not sure if anyone tried that yet - don't remember if I did.
IMO vscode errors are too noisy as they show to the user, as big popups in the screen... vim/emacs show a message in the minibuffer which is a one line small buffer down there in the editor, that's why I think most users that are affected by those things are calva users
> IMO vscode errors are too noisy as they show to the user, as big popups in the screen... Yes, I agree
the way they show in the editor, as a popup that is pretty big enough to bother users. This is the emacs minibuffer where those things show to user
but I think this is how vscode is, not sure there is a cleaner way to present things to user
I was just wondering what you meant by: > or how to show a less noisy popup IMO, any VS Code popup for these errors is too noisy / annoying, but I think we're on the same page there.
There may be a cleaner way, like output channels, but these errors are already shown in the client<->server output channel. However, that has to be enabled, and the user has to look there. Maybe we could pop that open / bring it up when an error happens to it's in their view automatically, but I'm not sure how easy / possible that is.
Anyway, I made clojure-lsp not show those "errors" when there is nothing to clean, at least that refactor won't bother anymore

> Maybe we could pop that open / bring it up when an error happens to it’s in their view automatically, but I’m not sure how easy / possible that is. That was what I was referring to above when I said I have spent many, many hours trying to do. It could still be easy, of course. But it ain’t for lack of trying that we are not doing it already.
At least the VS Code team now confirmed that it can’t be done from the lsp client setup: https://github.com/microsoft/vscode-discussions/discussions/579
there is, check https://clojure-lsp.io/features/#clojure-lsp-extra-commands the add-missing-import code action or command
Oh I see, I guess in Emacs it's called add-missing-libspec? Maybe that's why I could not find it
yep, but I strongly suggest you not use manual commands, but the code actions lsp-execute-code-action
because it shows all available actions for that line with a way better UX
ah, and I think add-missing-libspec
works only for requires, not imports, one more reason to rely on code actions, you don't need to know those internal things
The code action doesn't show up though.
(Instant/now)
When I code action on that it doesn't have the optionI updated, and I still can't see it: :server-version "2023.05.04-19.38.01", :clj-kondo-version "2023.04.15-SNAPSHOT"
Could you check if that happens on https://github.com/ericdallo/clojure-sample?
that's weird, here's a gif of the working for me on that project.
Could you share the output of your lsp-clojure-server-info
plz, it should print in the messages buffer?
{:final-settings
{:source-aliases #{:test :dev},
:uri-format
{:upper-case-drive-letter? false, :encode-colons-in-path? false},
:cljfmt-config-path ".cljfmt.edn",
:document-formatting? true,
:source-paths
["/home/didier/documents/clojure-sample/test"
"/home/didier/documents/clojure-sample/resources"
"/home/didier/documents/clojure-sample/src"],
:text-document-sync-kind nil,
:project-specs
({:project-path "project.clj",
:classpath-cmd
["/usr/local/bin/lein" "with-profile" "+test,+dev" "classpath"]}
{:project-path "deps.edn",
:classpath-cmd
["/home/linuxbrew/.linuxbrew/bin/clojure" "-A:test:dev" "-Spath"]}
{:project-path "build.boot",
:classpath-cmd ["boot" "show" "--fake-classpath"]}
{:project-path "shadow-cljs.edn",
:classpath-cmd
["/home/didier/.npm-global/bin/npx" "shadow-cljs" "classpath"]}
{:project-path "bb.edn",
:classpath-cmd
["/home/linuxbrew/.linuxbrew/bin/bb"
"print-deps"
"--format"
"classpath"]}),
:dependency-scheme "jar",
:show-docs-arity-on-same-line? true,
:document-range-formatting? true},
:classpath
#{"/home/didier/.m2/repository/org/checkerframework/checker-qual/2.0.0/checker-qual-2.0.0.jar"
"/home/didier/.m2/repository/joda-time/joda-time/2.10/joda-time-2.10.jar"
"/home/didier/.m2/repository/org/clojure/tools.analyzer/1.1.0/tools.analyzer-1.1.0.jar"
"/home/didier/.m2/repository/org/clojure/clojure/1.10.3/clojure-1.10.3.jar"
"/home/didier/.m2/repository/org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA.jar"
"/home/didier/.m2/repository/org/clojure/tools.reader/1.3.6/tools.reader-1.3.6.jar"
"/home/didier/.m2/repository/org/ow2/asm/asm/9.2/asm-9.2.jar"
"/home/didier/.m2/repository/clj-tuple/clj-tuple/0.2.2/clj-tuple-0.2.2.jar"
"/home/didier/.m2/repository/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar"
"/home/didier/.m2/repository/org/clojure/core.async/1.5.648/core.async-1.5.648.jar"
"/home/didier/.m2/repository/potemkin/potemkin/0.4.4/potemkin-0.4.4.jar"
"/home/didier/.m2/repository/fipp/fipp/0.6.17/fipp-0.6.17.jar"
"/home/didier/.m2/repository/org/clojure/tools.analyzer.jvm/1.2.2/tools.analyzer.jvm-1.2.2.jar"
"/home/didier/.m2/repository/slingshot/slingshot/0.12.2/slingshot-0.12.2.jar"
"/home/didier/.m2/repository/midje/midje/1.10.4/midje-1.10.4.jar"
"/home/didier/.m2/repository/org/clojure/core.unify/0.5.7/core.unify-0.5.7.jar"
"/home/didier/.m2/repository/com/google/jsinterop/base/1.0.0/base-1.0.0.jar"
"/home/didier/.m2/repository/org/clojars/brenton/google-diff-match-patch/0.1/google-diff-match-patch-0.1.jar"
"/home/didier/.m2/repository/com/google/errorprone/error_prone_annotations/2.3.1/error_prone_annotations-2.3.1.jar"
"/home/didier/.m2/repository/org/clojure/core.specs.alpha/0.2.56/core.specs.alpha-0.2.56.jar"
"/home/didier/.m2/repository/org/clojure/google-closure-library-third-party/0.0-20191016-6ae1f72f/google-closure-library-third-party-0.0-20191016-6ae1f72f.jar"
"/home/didier/.m2/repository/com/google/guava/guava/25.1-jre/guava-25.1-jre.jar"
"/home/didier/.m2/repository/com/cognitect/transit-java/0.8.332/transit-java-0.8.332.jar"
"/home/didier/.m2/repository/nubank/matcher-combinators/3.3.1/matcher-combinators-3.3.1.jar"
"/home/didier/.m2/repository/com/google/protobuf/protobuf-java/3.11.1/protobuf-java-3.11.1.jar"
"/home/didier/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.8.7/jackson-core-2.8.7.jar"
"/home/didier/.m2/repository/marick/suchwow/6.0.2/suchwow-6.0.2.jar"
"src"
"/home/didier/.m2/repository/org/clojure/core.cache/1.0.225/core.cache-1.0.225.jar"
"/home/didier/.m2/repository/com/google/javascript/closure-compiler-externs/v20200315/closure-compiler-externs-v20200315.jar"
"/home/didier/.m2/repository/com/google/code/gson/gson/2.7/gson-2.7.jar"
"/home/didier/.m2/repository/clj-time/clj-time/0.15.1/clj-time-0.15.1.jar"
"/home/didier/.m2/repository/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar"
"/home/didier/.m2/repository/com/rpl/specter/1.0.5/specter-1.0.5.jar"
"/home/didier/.m2/repository/mvxcvi/arrangement/1.2.0/arrangement-1.2.0.jar"
"/home/didier/.m2/repository/org/msgpack/msgpack/0.6.12/msgpack-0.6.12.jar"
"/home/didier/.m2/repository/colorize/colorize/0.1.1/colorize-0.1.1.jar"
"/home/didier/.m2/repository/org/clojure/core.rrb-vector/0.0.14/core.rrb-vector-0.0.14.jar"
"/home/didier/.m2/repository/mvxcvi/puget/1.1.2/puget-1.1.2.jar"
"/home/didier/.m2/repository/org/clojure/data.priority-map/1.1.0/data.priority-map-1.1.0.jar"
"/home/didier/.m2/repository/com/cognitect/transit-clj/0.8.309/transit-clj-0.8.309.jar"
"/home/didier/.m2/repository/commons-codec/commons-codec/1.11/commons-codec-1.11.jar"
"/home/didier/.m2/repository/flare/flare/0.2.9/flare-0.2.9.jar"
"/home/didier/.m2/repository/com/google/javascript/closure-compiler-unshaded/v20200315/closure-compiler-unshaded-v20200315.jar"
"/home/didier/.m2/repository/org/clojure/spec.alpha/0.2.194/spec.alpha-0.2.194.jar"
"/home/didier/.m2/repository/org/clojure/math.combinatorics/0.1.6/math.combinatorics-0.1.6.jar"
"/home/didier/.m2/repository/org/tcrawley/dynapath/1.0.0/dynapath-1.0.0.jar"
"/home/didier/.m2/repository/com/google/re2j/re2j/1.3/re2j-1.3.jar"
"/home/didier/.m2/repository/org/clojure/tools.macro/0.1.5/tools.macro-0.1.5.jar"
"/home/didier/.m2/repository/org/clojure/test.check/0.10.0-alpha3/test.check-0.10.0-alpha3.jar"
"/home/didier/.m2/repository/riddley/riddley/0.1.12/riddley-0.1.12.jar"
"/home/didier/.m2/repository/io/aviso/pretty/0.1.37/pretty-0.1.37.jar"
"/home/didier/.m2/repository/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar"
"/home/didier/.m2/repository/org/clojure/tools.namespace/0.3.0/tools.namespace-0.3.0.jar"
"/home/didier/.m2/repository/org/clojure/clojurescript/1.10.758/clojurescript-1.10.758.jar"
"/home/didier/.m2/repository/org/clojure/java.classpath/0.2.3/java.classpath-0.2.3.jar"
"/home/didier/.m2/repository/org/clojure/google-closure-library/0.0-20191016-6ae1f72f/google-closure-library-0.0-20191016-6ae1f72f.jar"
"/home/didier/.m2/repository/org/clojure/data.json/0.2.6/data.json-0.2.6.jar"
"/home/didier/.m2/repository/org/clojure/core.memoize/1.0.253/core.memoize-1.0.253.jar"
"/home/didier/.m2/repository/com/google/elemental2/elemental2-core/1.0.0-RC1/elemental2-core-1.0.0-RC1.jar"
"/home/didier/.m2/repository/com/google/jsinterop/jsinterop-annotations/1.0.2/jsinterop-annotations-1.0.2.jar"
"resources"
"/home/didier/.m2/repository/environ/environ/1.1.0/environ-1.1.0.jar"
"/home/didier/.m2/repository/args4j/args4j/2.0.26/args4j-2.0.26.jar"
"test"
"/home/didier/.m2/repository/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar"},
:cljfmt-raw "{}",
:client-settings
{:dependency-scheme "jar",
:show-docs-arity-on-same-line? true,
:text-document-sync-kind nil,
:source-paths nil,
:source-aliases nil,
:cljfmt-config-path ".cljfmt.edn",
:document-formatting? true,
:document-range-formatting? true},
:project-root-uri "file:///home/didier/documents/clojure-sample",
:port "NREPL only available on :debug profile (`bb debug-cli`)",
:project-settings {},
:server-version "2023.05.04-19.38.01",
:clj-kondo-version "2023.04.15-SNAPSHOT",
:log-path "/tmp/clojure-lsp.12540916746229275776.out",
:classpath-settings nil}
Could you update clojure-lsp to latest released this week + show a print of what happens when you type lsp-execute-code-action
?
I tried deleting my .emacs.d, and installig lsp fresh. I get the same thing, but I see in the Message buffer: error in process sentinel: Attempt to accept output from process Compiling: /home/didier/.emacs.d/elpa/28.2/develop/lsp-mode-20230628.1609/lsp-fortran.el locked to thread #<thread 0x55ce5e2eb020> [2 times] error in process sentinel: Attempt to accept output from process Compiling: /home/didier/.emacs.d/elpa/28.2/develop/lsp-mode-20230628.1609/lsp-graphql.el locked to thread #<thread 0x55ce5e2eb020> [2 times] error in process sentinel: Attempt to accept output from process Compiling: /home/didier/.emacs.d/elpa/28.2/develop/lsp-mode-20230628.1609/lsp-fsharp.el locked to thread #<thread 0x55ce5e2eb020> [2 times] error in process sentinel: Attempt to accept output from process Compiling: /home/didier/.emacs.d/elpa/28.2/develop/lsp-mode-20230628.1609/lsp-groovy.el locked to thread #<thread 0x55ce5e2eb020> [2 times] error in process sentinel: Attempt to accept output from process Compiling: /home/didier/.emacs.d/elpa/28.2/develop/lsp-mode-20230628.1609/lsp-haxe.el locked to thread #<thread 0x55ce5e2eb020> [2 times] error in process sentinel: Attempt to accept output from process Compiling: /home/didier/.emacs.d/elpa/28.2/develop/lsp-treemacs-20230703.629/lsp-treemacs.el locked to thread #<thread 0x55ce5e2eb020> [2 times] error in process sentinel: Attempt to accept output from process Compiling: /home/didier/.emacs.d/elpa/28.2/develop/lsp-mode-20230628.1609/lsp-openscad.el locked to thread #<thread 0x55ce5e2eb020> [2 times] error in process sentinel: Attempt to accept output from process Compiling: /home/didier/.emacs.d/elpa/28.2/develop/lsp-mode-20230628.1609/lsp-ocaml.el locked to thread #<thread 0x55ce5e2eb020> [2 times] error in process sentinel: Attempt to accept output from process Compiling: /home/didier/.emacs.d/elpa/28.2/develop/lsp-mode-20230628.1609/lsp-lua.el locked to thread #<thread 0x55ce5e2eb020> [2 times] error in process sentinel: Attempt to accept output from process Compiling: /home/didier/.emacs.d/elpa/28.2/develop/lsp-mode-20230628.1609/lsp-kotlin.el locked to thread #<thread 0x55ce5e2eb020> [2 times] error in process sentinel: Attempt to accept output from process Compiling: /home/didier/.emacs.d/elpa/28.2/develop/lsp-mode-20230628.1609/lsp-json.el locked to thread #<thread 0x55ce5e2eb020> [2 times] Not sure if related