This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-15
Channels
- # announcements (8)
- # asami (10)
- # babashka (16)
- # beginners (86)
- # calva (22)
- # chlorine-clover (9)
- # circleci (20)
- # clj-kondo (13)
- # cljs-dev (20)
- # cljsrn (3)
- # clojure (144)
- # clojure-australia (10)
- # clojure-europe (126)
- # clojure-italy (5)
- # clojure-nl (8)
- # clojure-norway (4)
- # clojure-serbia (9)
- # clojure-uk (7)
- # clojurescript (14)
- # cursive (20)
- # data-science (1)
- # datomic (20)
- # figwheel-main (5)
- # fulcro (23)
- # graalvm (7)
- # graphql (25)
- # honeysql (15)
- # hugsql (3)
- # jobs (2)
- # lambdaisland (2)
- # leiningen (4)
- # lsp (102)
- # malli (3)
- # off-topic (51)
- # overtone (5)
- # pathom (27)
- # portal (11)
- # quil (1)
- # re-frame (19)
- # reagent (31)
- # remote-jobs (1)
- # reveal (3)
- # rewrite-clj (56)
- # shadow-cljs (45)
- # startup-in-a-month (1)
- # tools-deps (9)
things got a bit out of sync when i added a require to a namespace. is there a way to have lsp reparse the current file? I had to resort to restarting the workspace
yeah. i edited and saved and it didn't like the state it ended up in. My evidence for that is the highlighting of words under point was nonsensical. Like it would highlight the third and fourth letters of a function and didn't recognize the other call sites
restarted the workspace and it got it right, highlighting the entire token and highlighting the other usages of the same
Yeah I've seen this too recently. I'm pretty suspicious of using this partial changes api @ericdallo https://github.com/clojure-lsp/clojure-lsp/blob/master/src/clojure_lsp/feature/file_management.clj#L107 I think there's a lot that can go wrong there.
it sure is hard to get it right and since ericdallo didn't mention my name in that commit, I take no responsibility for it :P
is there a way to reanalyze current file? kinda just kick clojure-lsp? Or is the best workaround at the moment to restart the workspace?
but it could be related to the problem discussed above with partial snippets that are sent over the wire
if you edit files outside of your lsp environment, those edits might not be seen by lsp?
that makes sense. thanks @ericdallo
re-editing should not fix since if one edit go out of sync, all other probably will go wrong too
@snoe it was handling ranges for a long time, the change was to add full text support.
I could not reproduce the edit sync error, if you have a repro we could improve that
The neovim client is always sending the whole text. Perhaps the Emacs client could be configured to do the same?
@orestis actually we used to use the full text since the beginning, I changed recently with the help of @borkdude to use the range edit changes
there's a capabilities negotiation so the server can tell lsp-mode it only support full-text afaik
@ericdallo I suggested above to make this feature experimental and opt-in using a flag in the .lsp/config.edn - thoughts?
yes, we could go this way, but that will probably make it hard to get the corner cases
Not sure if we should try to find the issue and fix it, We are already using it and it works for most cases (I use it daily and could not repro the out of sync issue yet)
the incremental didChanges increased the performance on medium/large buffers a lot, I think we should try to make that happen
That made the performance worst because of a lsp-mode limitation with completion, but besides that, with this feature, every change you do in a big buffer is more smooth
https://github.com/clojure-lsp/clojure-lsp/blob/master/src/clojure_lsp/feature/file_management.clj#L136 this seems suspicious - there's no check here that the current version is older than what's being applied and I can't reason through the async nature of analyze-changes but I would be surprised if there's no issue there. And I think debouncing with a change api is big no-no
the debouncing help us now call clj-kondo on every change if user input a lot of characters
if you type "abc" does it coalesce all of the changes into "abc" or is it possible you'd see "ab" and then "c"?
it should join all changes to abc correctly with my tests, maybe is some specific corner case
my tests I inputed dozens of characters to check if any race condition could cause trouble, and everyting worked great
Hey I dunno if is related to the issues being discussed today, but I'm getting a strange crash error after I updated today 🧵
After using a little bit the server crashes all functionalities stop working I need to force a lsp server restart.
It seems to be a issue indeed, do you have a code repro of when this exception happens?
It happens randomly I was in a fixture test file with a lot of defs
Just editing the file and saving
I just caused a random typo error and now the server crashed with this error:
[1;31mjava.lang.Exception[m: [3mUnexpected EOF. [at line 53, column 1][m
the issue happens during the parse of a clj-kondo lint findings, but I still not sure when it happens
Just created a file and started typing random code and this error happened
clojure-lsp 2021.03.14-23.22.46
clj-kondo 2021.03.03
oh wait maybe is my java version
openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment (build 11.0.10+9)
OpenJDK 64-Bit Server VM (build 11.0.10+9, mixed mode)
arch aur
yeah is random
I will move now
yeah still happening without the kondo files
[1;31mjava.lang.Exception[m: [3mUnmatched delimiter: } [at line 40, column 1][m
@UMMMKKADU the second log, the issue happen on didOpen
that is when client send to server that a new file was opened in the client editor, and we can see that is a StringIndexOutOfBoundsException
https://github.com/clojure-lsp/clojure-lsp/blob/master/src/clojure_lsp/feature/file_management.clj#L25 when is parsing the uri -> namespace
could you send the json log between client and server to check what your client is sending? I supposed you use vim, not sure how to get that log in vim lsp clients
@U11EL3P9U knows, I never know how to do this
what was the previous version that it was working @UMMMKKADU?
@borkdude from that log the didChange incremental change is a consequence of the didOpen exception, not the cause
I don't remember I can try rollback some versions
@ericdallo if you type (defn asdljkfjkasldfkjlsdaf)
in a clojure file save and try to go to definition you don't get this error?
No, I don't. I'm starting to think that the client is sending some messy range? that's why the request and response log could help
https://clojurians.slack.com/archives/CPABC1H61/p1615842711118400?thread_ts=1615839832.111100&cid=CPABC1H61 Did that work?
nothing relevant comming out
## versions
vim version: NVIM v0.4.4
node version: v14.15.3
coc.nvim version: 0.0.80-98a0c6db19
coc.nvim directory: /home/delboni/.local/share/nvim/plugged/coc.nvim
term: xterm-256color
platform: linux
## Log of coc.nvim
2021-03-15T18:15:33.518 INFO (pid:31644) [services] - registered service "languageserver.godot"
2021-03-15T18:15:33.520 INFO (pid:31644) [services] - registered service "languageserver.clojure-lsp"
2021-03-15T18:15:33.522 INFO (pid:31644) [services] - clojure-lsp state change: stopped => starting
2021-03-15T18:15:33.540 INFO (pid:31644) [services] - registered service "eslint"
2021-03-15T18:15:33.542 INFO (pid:31644) [plugin] - coc.nvim 0.0.80-98a0c6db19 initialized with node: v14.15.3 after 93ms
2021-03-15T18:15:33.547 INFO (pid:31644) [language-client-index] - Language server "languageserver.clojure-lsp" started with 31655
2021-03-15T18:15:44.639 INFO (pid:31644) [services] - clojure-lsp state change: starting => running
2021-03-15T18:15:44.644 INFO (pid:31644) [services] - service languageserver.clojure-lsp started
2021-03-15T18:15:45.105 INFO (pid:31644) [attach] - receive notification: showInfo []
It should be a log with the content of the request and response from client <-> server
@U11EL3P9U we could maybe document that on https://clojure-lsp.github.io/clojure-lsp/troubleshooting/
@UMMMKKADU it'd be nice if you could test other versions until we find the version that introduced the issue And find the logs as well 😅
2021.03.06-17.05.35 is working fine here, I will do some more tests tomorrow
Ok LGTM @U11EL3P9U, it'd be better if it makes sense to another vim user, could you check that PR later @UMMMKKADU?
Just a followup, using the previous version all is working fine here.
@UMMMKKADU I'll release a new version tonight rollingback the incremental text changes until we fix it, maybe it should fix your issue
@UMMMKKADU could you try latest release? https://clojurians.slack.com/archives/CPABC1H61/p1615928058014500
Just installed this one right?
clojure-lsp 2021.03.16-20.28.06
clj-kondo 2021.03.03
I will use it today and report here
thanks
I worked all day with the new version and zero problems thanks