-
-
Notifications
You must be signed in to change notification settings - Fork 219
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
Rework how the project directory is determined for jack-in and connect #275
Conversation
First we try find the workspace root, _then_ we add custom sub dir
Please merge it if you think it is good enough. 😄 |
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.
Looks good.
But i think i found a problem , and it might be the reason why i thought this is buggy.
When you Jack-In the Terminal says "Executing task in folder ...."
After that i always canceled the process. This time i just let it run and it is the right Project.
But i have no idea where that might happen
I think I might have been using the wrong constructor overload for the Task all this time. Fixed that now. Can you try and see if it fixes the problem? If so we should have a much more reliable jack-in for projects not in the workspace root now. |
Removes `projectRootDir` setting and uses this logic instead: 1. If there is no file open. Stop and complain. 2. If there is a file open, use it to determine the project root by looking for project files from the file's directory and up to the window root (for plain folder windows) or the file's workspace folder root (for workspaces) to find the project root. Return 1. the window root for plain folders 2. first workspace root for workspaces.
Also like we discussed to remind you, add some documentation to the function that you are currently working on :). |
Now I have made the project root something we need to initialize as the start of the jack-in and (standalone) connect processes. When the path is actually needed, this initialized value will be used. Should be both more efficient and less error prone. I also added that doc string, finally. 😄 Which was a very good thing to add, because the way I had phrased the strategy used... It made me realize that this new way of finding the project files isn't implementing that strategy! This will now fail for the ”plain” folder, multi-project case. (I haven't tested that yet, but I am pretty certain.) Committing this anyway, so that I can get your help with sanity checking the general change for init-then-use. Will restore the old new way of finding the project files now. Then, maybe, this is closing in on being ready to merge. |
This now works for the plain folder multi project case. I've tested it with Leiningen, Clojure CLI and shadow-cljs. An inconvenience is that Calva remembers the jack-in and connect picker selections per workspace which can be confusing and trick people to accept the wrong defaults. I think we should fix that before shipping. What say you? I'll make some tests with a real workspace now. Please put it to a test on your side as well. |
VSIX package built and sent to |
Hi @PEZ I found that broke my Jack-In presets. I need "projectRootDir" setting so that I can choose another project having the same source file. Is it possible to restore it? |
Sorry, I got it wrong. I was actually using a custom Calva build from #580. |
So you're good now? |
Thanks for checking. I need that PR to be merged (as I need projectRootDir setting). I have a temporary workaround for now. |
First we try find the workspace root, then we add custom sub dir
Hello, can you review this fix of
getProjectDir()
for me? It is not supposed to add any fancy new possibilities, just fix so that a custom project root (sub directory) should work in more cases. It is a very central function so I'd appreciate an extra brain on it. Cheers!