-
Notifications
You must be signed in to change notification settings - Fork 185
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
Fix get_project_path for multi-directory workspaces #472
Conversation
While this does fix the CWD of spawned language servers, LSP still seems to stop functioning entirely when working in a non-primary directory in a workspace... I'm going to leave this open for the moment, but keep poking around to see if I can fix anything else. To see the problem first-hand:
The problem itself seems to be intermittent, and sometimes resolves itself when you restart Sublime, add/remove projects from your workspace, etc. This PR fixes things enough of the time to be worth merging, so I'll probably open a different PR sometime later this week if I can find the root of the problem. |
What's the progress on this? |
Haven't had time to work on this the past week, should have it sorted today. Sorry about the wait. |
Look good? @rwols |
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, thanks for your work!
Thanks for the contribution, but I will revert this change now in favour of a full solution. The existing behaviour was not a "logic error", the function even documented that it would return the first folder. (Also see the note in the troubleshooting section and issue #33 linked from it) I'm sure we can make multi-folder projects work reliably, but if we need to look closer at the usages of |
LSP should probably start communicating the current limitation by warning users and refusing server startup when files under the 2nd folder are opened. |
@tomv564: I don't follow your reasoning in reverting this. For workspaces with more than one active project, this evaluates to true, always returning the first directory of the workspace, even though the function is documented to return Further, as far as I am aware, this PR fixes the issues regarding LSP behavior in a multi-directory workspace. This was, after all, the entire point... |
The But perhaps this is a good time to look at supporting multi-directory workspaces: Say you have a window with two python projects:
Server sessions are shared per window
This is fixable with the cost of looking up the session by window root folder.
Support configuration per folder? A follow-up consideration: If users can have different sessions for |
Fixes a logic error that causes
get_project_path
to always return the first directory in the current workspace.