-
-
Notifications
You must be signed in to change notification settings - Fork 863
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
Use file-truename in lsp-f-canonical #3325
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The whole point of creating |
I agree with @yyoncho, we have been using |
I agree. I would prefer that everything works in the context as opened in emacs, but one cannot rely on projectile or on project.el backends to return the symliked folder. One can even imagine the situation where sim-link folder is not part of a project but the truename is. Regarding speed I cannot judge, the part that I am concerned with this PR is for interactive use, so no concern. |
One way to fix this is to alter If this is ok with you I can alter the PR. |
Can you give an example of that logic? In general |
What I meant is if you have R= When real project root=
(2.) can be optimized by chooping first time the entire common tail of the truename and symname. Why such a complex iterative procedure is required? One could imagine situations where a sub-project of a project A is symlinked as a sub-project of another project B, so the user would expect to get project B as root, but projectile would return project A because it operates on true file paths. Or, as I have seen before, people would simlink parts of the project into a sub-directory within the same project, and they want the sub-directory to be considered as a project. So it's a fundamental problem with how projectile computes the root. The only backend for project.el project-try-vc does the right thing and returns the symlinked path. |
6ddba85
to
9c60769
Compare
My proposal from the above is not necessary to fix the current issue. So I am proposing another patch. Also fixing the related diagnostic issue #3326 . |
- expand proj root: project.el backend can return an abbreviated root (e.g. ~/path/to/proj) - add cached lsp-file-truename
9c60769
to
313dc39
Compare
The problem: symlink any project and access files from the new location. When asked to pick the root press "i". Revert the buffer, it will ask again.
The problem is that `lsp--find-root-interactively returns a true filename of the root(because projectile does) and that is stored in the session file. But then, on subsequent file opening lsp-find-session-folder will not find the root because it operates with sym-linked filename.
I think an ideal scenario would be to differentiate between symlinked and true projects, but given that external tooling returns truenames, I don't think there is a better solution than what is proposed here.