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
Custom project root for all files in a project #3518
Comments
lsp-mode persists the roots in lsp-session-file and you should not be asked again. |
This is the content of my
I am very new to Emacs / elisp and I do not understend what this content means. But it seams impossible that this saves the association of all files I have associated to a given lsp-session. It seams it saved the lsp-session |
We use the nearest project root if it is already added. If you want to associate files outside of project root with a particular workspace, then there is |
This is exactly the case. My projects How can I leverage |
@witek we should add setting like we do here: https://github.com/yyoncho/lsp-mode/blob/master/clients/lsp-pylsp.el#L426 |
But is this really specific to the language specific code? I can imagine having the same issue regardless of the language. |
the setting can be exposed for all servers. The different servers might have different logic regarding the outside of root files. |
lsp--calculate-root
calculates the project root by asking the user vialsp--find-root-interactively
. Here I am missing an option to provide a custom project root for all files in the current project.My simplified problem / use case:
/p/mylib
/p/myapp
By default, Emacs starts a lsp-server / lsp session for each of these projects. This causes that
lsp-find-references
in/p/mylib
does not find the references in/p/myapp
. I would prefer the default behavior from VSCode. When adding two "folders" to a VSCode-workspace, there is a single lsp-server which serves both. And all lsp commands work across both folders.Since Emacs has projects instead of VSCode-workspaces and folders, this is tricky. I still want commands like
projectile-find-file
ormagit-status
to work on the individual projects. But I want lsp commands likelsp-find-references
to work accross multiple projects.I discovered that I can get this behavior by providing always the same value
/p/all-clj
as project root to the interactive question fromlsp--find-root-interactively
. But this question pops up on every file I open. There is no option to persist my custom root directory.Proposals:
lsp--find-root-interactively
so that the user can provide a custom project root which is saved as the value for all files in the current project.(or ...)
form inlsp--calculate-root
so that a variable is used as the return value. So that the user can set this variable in his configuration or in his.dir-locals.el
.The text was updated successfully, but these errors were encountered: