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

With multi-root workspaces the clojure-lsp project root is always the first folder #1706

Closed
PEZ opened this issue May 3, 2022 · 0 comments
Closed
Assignees
Labels

Comments

@PEZ
Copy link
Collaborator

PEZ commented May 3, 2022

Calva always initializes clojure-lsp with the first workspace folder in a VS Code Workspace. This is pretty abritrary and opaque for the user.

I think we need a way for the user to choose which project root should be used, like we do when connecting the nREPL client.

@PEZ PEZ added the lsp label May 3, 2022
@PEZ PEZ self-assigned this May 3, 2022
julienvincent added a commit to julienvincent/calva that referenced this issue Jan 19, 2023
Rework LSP to allow multi-project/workspace setups

Right now Calva only supports opening clojure projects from the root of
the project. This will be where the LSP process is started and the
clojure LSP needs a deps.edn/project.clj file to exist at it's root in
order to provide proper completions.

This also means that multi-workspace setups in VSCode is not really
supported.

This commit refactors the LSP implementation to allow provisioning
multiple LSP clients at different roots. Dependent systems can then
request the LSP client governing a particular file/directory.

This change simultaneously allows opening directories that contain
multiple projects as well as setting up multi-workspace vscode
configurations.

The LSP initialization logic is also altered such that the server is
started when a clojure file is opened rather than when Calva
initializes. This prevents poluting non-clojure projects with .lsp and
.clj-kondo directories.

Closes BetterThanTomorrow#934
Closes BetterThanTomorrow#1706
@PEZ PEZ closed this as completed in bc34181 Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant