This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-02
Channels
- # asami (5)
- # aws (16)
- # babashka (41)
- # babashka-sci-dev (44)
- # beginners (157)
- # biff (3)
- # cider (1)
- # clj-commons (1)
- # cljdoc (22)
- # clojure (7)
- # clojure-dev (5)
- # clojure-europe (13)
- # clojure-nl (1)
- # clojure-uk (1)
- # clojurescript (17)
- # core-typed (13)
- # cursive (14)
- # datascript (10)
- # events (1)
- # fulcro (2)
- # graalvm (2)
- # gratitude (1)
- # jobs (3)
- # lsp (229)
- # pathom (2)
- # pedestal (3)
- # portal (53)
- # re-frame (7)
- # remote-jobs (1)
- # spacemacs (14)
- # xtdb (6)
anyone else getting CRC mismatch errors when using the new Java features with a src.zip? (EDIT: was due to zlib 1.2.12
)
checking the src.zip archive with unzip -t
reports no errors
yeah, arch
I've seen this error when upgrading to zlib 1.12.2. Don't do that, keep using 1.12.1.
Maybe that's not an issue, since lsp isn't using musl. https://github.com/clojure-lsp/clojure-lsp/issues/868
I think I have zlib 1.2.12
I don't think it necessary needs to be compiled with musl, maybe the static with dynamic libc should also work
you're sharp today, thanks @UFDRD93RR :)
So just to confirm, @U0178V2SLAY you're building clojure-lsp yourself right? Either by AUR or something else
Yeah, this should be the case (I didn't confirm though). This is why I think this is a dynamic build of clojure-lsp
(not sure if the releases from GitHub are dynamically linked or something else, maybe @UKFSJSM38 can confirm this)
typically I get clojure-lsp
through AUR (https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=clojure-lsp-bin)
@UFDRD93RR how would those be different?
also, downgrading zlib to `1.2.11` solved the issue
I agree with @UFDRD93RR that adding the static-except-glibc would be the easiest and most safe solution
@U04V15CAJ you mean AUR vs GitHub?
I don't believe that particular PKGBUILD for clojure-lsp
performs any compilation, it's quite fast to install/upgrade. But I may be wrong.
I think clojure-lsp doesn't depend on Datalevin anymore, that was the previous issue of using musl
I think using the static-except-glibc will solve it for all platforms in the short term. Musl only works for amd64
setup-graalvm supports musl option, so it should be very easy to use that, since lsp uses github actions. I'm afk now.
thanks for the help debugging this 👍
@U0178V2SLAY There is a static build of clojure-lsp
: https://github.com/clojure-lsp/clojure-lsp/releases/download/2022.03.31-20.00.20/clojure-lsp-native-static-linux-amd64.zip
Not sure if this is musl or static with dynamically libc, but it doesn't matter for this issue
This modified PKGBUILD should be sufficient to fix the issue:
# Maintainer: David Harrigan <dharrigan [@] gmail [dot] com>
# Contributer: Mateen Ulhaq <mulhaq2005+aur at gmail dot com>
pkgname=clojure-lsp-bin
pkgver=2022.03.31_20.00.20
pkgrel=1
epoch=2
pkgdesc="Language Server (LSP) for Clojure"
arch=("x86_64")
url=""
license=("MIT")
depends=('gcc-libs')
provides=("${pkgname%-bin}")
conflicts=("${pkgname%-bin}")
source_x86_64=("${pkgname}-${pkgver}-native-static-linux-amd64.zip::${url}/releases/download/${pkgver//_/-}/clojure-lsp-native-static-linux-amd64.zip")
sha256sums_x86_64=('<PLEASE SET ME>')
package() {
install -Dm0755 -t "$pkgdir/usr/bin/" "${pkgname%-bin}"
}
Of course, please update the sha256sums_x86_64
thanks, I'll test that later 👍 I don't think I actually need the PKGBUILD, as I can just extract the binary somewhere and instruct lsp-mode
to use that instead of the AUR version.
Sorry for the delay: • Arch AUR just download the release from GitHub • There is a issue I intend to solve to next release to make static binary use musl for static binary
@U11EL3P9U, maybe it'd be nice if the AUR compile clojure-lsp with Graal instead of downloading the release? Not sure, I'm not a AUR user and don't know if that is common
I don't know if that would be a good choice for AUR, as it would require quite a bit of scaffolding and compilation for the end-user.
> • Use you can use static except glibc maybe by default to circumvent the zlib issue Using musl would'nt fix that?
https://github.com/clojure-lsp/clojure-lsp/blob/master/cli/graalvm/native-unix-compile.sh#L31
Aha. Then it is surprising why @U0178V2SLAY had this problem still
Maybe @U11EL3P9U can confirm this on AUR
The above problem should be already solved if the AUR was using the static binary
I've pushed an update to AUR which favours the static version of clojure-lsp over the native (dynamic) version. Let's see how it goes.
Seems to be working great 👍 I upgraded both clojure-lsp
and zlib
(to revert the downgrade I made yesterday), cleared the global lsp cache and opened my project -> the source zip was extracted and analyzed ok
Great, thank you @U11EL3P9U!
I don’t use clojure-lsp at the moment, but if there's something I can help with (testing, documentation, etc), let me know.
It seems the docs are still based on the .jar file: https://lsp.sublimetext.io/language_servers/#clojure
Howdy! I'm using clojure-lsp
with lsp-mode
in Emacs in a relatively simple CLJS project but I can't get most of the refactorings to work (clojure-lsp 2022.03.31-20.00.20, clj-kondo 2022.03.10-SNAPSHOT)
What's working: • find references • jump to definition • helm-lsp-code-actions, "Extract function" • remame symbol
But other refactorings don't appear to do anything (I don't see an error message either)
• I select [1 2 3]
and then helm-lsp-code-actions, "Change coll to set" — no effect
• I move my cursor on an expression, then helm-lsp-code-actions, "Move to let" — no effect
In particular the "change coll" refactoring is so simple that I'm wondering if I'm doing something wrong (I've tried these now and then in the last few years and it never worked reliably for me)
lsp-mode-20220315.1736, clojure-mode-20220307.1903 and helm-lsp-20210419.2014 if that helps
I tried to find the log file, but there was no /tmp/clojure-lsp.<TIMESTAMP>.out
. However, when configuring the path manually (`{:log-path "/tmp/clojure-lsp.out"}`) the logfile appeared
When I run Convert coll to set
, this is what I get
2022-04-02T19:36:38.419Z INFO [clojure-lsp.handlers:385] - :code-actions 2ms
2022-04-02T19:36:40.157Z INFO [clojure-lsp.handlers:338] - :execute-command 2ms
2022-04-02T19:36:40.697Z INFO [clojure-lsp.handlers:237] - :document-highlight 0ms
2022-04-02T19:36:40.699Z INFO [clojure-lsp.handlers:385] - :code-actions 2ms
If it helps, this is the project and line: https://github.com/pesterhazy/shadow-jest/blob/exp/src/main/tdd/infra/cmdline.cljs#L11 (the branch is exp
)
As an example I'm trying to convert ["x" "x"]
into a list
Let me try Calva to see if it works there
It seems to work in Calva
All the following seem to be working: convert coll to set, move to let, unwind thread
None of them work on my lsp-mode install though
@U06F82LES, I think we need to debug what the client (lsp-mode) is sending to clojure-lsp, could you try get the <https://clojure-lsp.io/troubleshooting/#client-server-log%7Cclient<->server> log of that executeComand that is sent to clojure-lsp?
mine looks like this:
[Trace - 05:01:06 PM] Sending request 'workspace/executeCommand - (87232)'.
Params: {
"command": "change-coll",
"arguments": [
"file:///tmp/clojure-lsp/shadow-jest/src/main/tdd/infra/cmdline.cljs",
10,
45,
"list"
]
}
[Trace - 05:01:06 PM] Received response 'workspace/executeCommand - (87232)' in 0ms.
Result: 0
Ok let me try
Ok there's a lot there but I'm picking out the workspace/executeCommand entry
[Trace - 10:10:58 PM] Sending request 'workspace/executeCommand - (87)'.
Params: {
"command": "change-coll",
"arguments": [
"file:///Users/user/pitch/shadow-jest/src/main/tdd/infra/cmdline.cljs",
10,
53,
"set"
]
}
[Trace - 10:10:58 PM] Received response 'workspace/executeCommand - (87)' in 7ms.
Result: 0
I moved the cursor to the beginning of the coll, then I get the same as yours
[Trace - 10:13:54 PM] Sending request 'workspace/executeCommand - (132)'.
Params: {
"command": "change-coll",
"arguments": [
"file:///Users/user/pitch/shadow-jest/src/main/tdd/infra/cmdline.cljs",
10,
45,
"list"
]
}
[Trace - 10:13:54 PM] Received response 'workspace/executeCommand - (132)' in 10ms.
Result: 0
yeah, but it doesn't change anything in the editor
I just deleted my elpa folder to get the latest release
that didn't seem to fix it (maybe that's not master though?)
maybe something about my lsp-mode configuration https://github.com/pesterhazy/emacs.d/blob/master/init.el#L310
it's vanilla emacs but I'm using evil-mode and a bunch of other packages to make it feel like spacemacs
mine:
[Trace - 05:20:21 PM] Received request 'workspace/applyEdit - (6).
Params: {
"edit": {
"documentChanges": [
{
"textDocument": {
"version": 16,
"uri": "file:///tmp/clojure-lsp/shadow-jest/src/main/tdd/infra/cmdline.cljs"
},
"edits": [
{
"range": {
"start": {
"line": 10,
"character": 45
},
"end": {
"line": 10,
"character": 54
}
},
"newText": "[\"x\" \"x\"]"
}
]
}
]
}
}
[Trace - 05:20:21 PM] Sending response 'workspace/applyEdit - (6)'. Processing request took 32ms
Params: {
"jsonrpc": "2.0",
"id": "6",
"result": {
"applied": true
}
}
I don't have any of those
only workspace/executeCommand, never workspace/applyEdit
so that seems like it could be the problem—it never sends workspace/applyEdit
is that clojure-lsp's responsibility or lsp-mode's?
Apr 02, 2022 10:21:08 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation
WARNING: Unmatched cancel notification for request id 2
Apr 02, 2022 10:21:08 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint handleCancellation
WARNING: Unmatched cancel notification for request id 6
one sec
sorry I'm stupid but I don't know how to focus that little window ("minibuffer"?) and if I click on it to copy and paste, it disappears
weird I had to click 2x
here it is
so, the issue seems that clojure-lsp is not sending workspace/applyEdit at all, that's why multiple features are not working
could you try a non native-image graalvm compiled binary? just download the clojure-lsp
one from https://github.com/clojure-lsp/clojure-lsp/releases
then on your emacs set like this:
(setq lsp-clojure-custom-server-command '("bash" "-c" "/path/to/clojure-lsp"))
btw when I try the "extract function" action that does work, and it does generate workspace/applyEdit
will try the non-graal binary now
Exception in thread "main" java.lang.UnsupportedClassVersionError: clojure_lsp/feature/test_tree/TestTreeParams has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
haha finally something that doesn't work with my ancient java8
well, you could try download clojure-lsp repo and make
, it should create a clojure-lsp
at the project root
I'll just upgrade java I think
ok that works now with java 18 (went up 10 versions today - you can tell I'm conservative)
is this expected?
~/Downloads/clojure-lsp
WARNING: abs already refers to: #'clojure.core/abs in namespace: medley.core, being replaced by: #'medley.core/abs
probably related to clojure 1.11's new clojure.core/abs?
omg that worked
moved the binary to /usr/local/bin, uninstalled the native binary just to be sure
Please open a issue with those details so we can investigate it later, it doesn't seems that easy to fix/find the root issue
hm! it only worked the first time. If I try again, it fails
I can change it into a set, but not back to a vector. wtf?
well ok, so if I lsp-workspace-restart, then I get one workingg refactoring again - after that it stops working
that doesn't make much sense, are you sure your are using the download non graal binary right?
I just tried again with the graal binary, that doesn't work at all (even the first time)
pretty weird, could you check if with the non graal one clojure-lsp just send the first workspace/applyEdit?
ok I'm back to non-graal now
yeah so first time I get workspace/applyEdit (-> works), second time no such message (-> fails)
(just to be sure, I don't need to save the buffer between code actions, right?)
right that's what I thought
yeah, that's a new weird issue I never saw 😅 , it could be a new behavior from recent releases, could you try a older release?
I can see similar behavior with unwind-thread-all - it works but then stops working
lsp-workspace-restart then makes it work again
OK I tried a January release (non-graal) and that doesn't show the problem https://github.com/clojure-lsp/clojure-lsp/releases/tag/2022.01.22-01.31.09
let me bisect releases...
so it looks like the problem was introduced after https://github.com/clojure-lsp/clojure-lsp/releases/tag/2022.01.22-01.31.09 but before https://github.com/clojure-lsp/clojure-lsp/releases/tag/2022.02.01-16.53.14
FWIW download size went down from 32.9M (GOOD) to 26.2M (BAD)
So, one of those changes, right? https://github.com/clojure-lsp/clojure-lsp/releases/tag/2022.02.01-16.53.14
Maybe related: > • Bump Graalvm from 21.3.0 to 22.0.0.2 improving binary performance/size >
need to be AFK for some time, but feel free to open a issue or try bisecting those commits (I know it's annoying :/)
well, given that I'm using the non-graal version in both cases, the problem shouldn't be related to graal right?
@UKFSJSM38 created an issue and tried my best to find a minimal repro https://github.com/clojure-lsp/clojure-lsp/issues/903
interestingly with the January release, even the graal binary works perfectly
Let me know if you need any additional info (or if you want me to bisect more granularly)
As always, thanks for the great work on clojure-lsp!