Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clojure-lsp initialized in a non-working state when there is no VS Code folder #1664

Closed
PEZ opened this issue Apr 5, 2022 · 0 comments · Fixed by #1666
Closed

clojure-lsp initialized in a non-working state when there is no VS Code folder #1664

PEZ opened this issue Apr 5, 2022 · 0 comments · Fixed by #1666
Assignees
Labels
bug Something isn't working lsp

Comments

@PEZ
Copy link
Collaborator

PEZ commented Apr 5, 2022

VS Code assumes it has a folder open when starting the LSP client. Otherwise it initializes the server with a null for rootUri. And this leaves clojure-lsp in a non-working state.

This can happen with the standalone REPLs which as a feature can be started standalone from a VS Code folder (see #1601). It can also happen if the user opens Clojure file, or creates a Clojure document. Or, in fact, any of the actions where Calva is configured to activate.

This gets a bit extra bad for the user because the main options for diagnostics we provide LSP serverInfo, and Open LSP log both crash inside clojure-lsp when the rootUri is not set. And as Calva uses serverInfo as part of the activation of clojure-lsp things are a bit in limbo here.

My analysis is that we are starting clojure-lsp prematurely, we need to know the rootUri, or that there is a VS Code folder open, before we start clojure-lsp.

@PEZ PEZ added bug Something isn't working lsp labels Apr 5, 2022
@PEZ PEZ self-assigned this Apr 5, 2022
PEZ added a commit that referenced this issue Apr 6, 2022
clojure-lsp does not like root-less existence see #1601 and #1664
This commit also changes things so that we don't start
clojure-lsp until we have something Clojure-y to chew on.

TODO: clojure-lsp does now not start automatically when Calva
is activated because the iser is starting standalone REPLs.
PEZ added a commit that referenced this issue Apr 6, 2022
PEZ added a commit that referenced this issue Apr 7, 2022
clojure-lsp does not like root-less existence see #1601 and #1664
This commit also changes things so that we don't start
clojure-lsp until we have something Clojure-y to chew on.

TODO: clojure-lsp does now not start automatically when Calva
is activated because the iser is starting standalone REPLs.
PEZ added a commit that referenced this issue Apr 7, 2022
PEZ added a commit that referenced this issue Apr 8, 2022
clojure-lsp does not like root-less existence see #1601 and #1664
This commit also changes things so that we don't start
clojure-lsp until we have something Clojure-y to chew on.

TODO: clojure-lsp does now not start automatically when Calva
is activated because the iser is starting standalone REPLs.
@bpringe bpringe closed this as completed in 0adc69d Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lsp
Projects
None yet
1 participant