-
Notifications
You must be signed in to change notification settings - Fork 72
load dependency graph based on data of workspace-state.json #378
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
load dependency graph based on data of workspace-state.json #378
Conversation
Can one of the admins verify this patch? |
3 similar comments
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
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.
These changes look good. I was going to hold off on merging this because I was just about to do a new release but it looks like it is going to be delayed by a few days, so these changes should have time to bed in.
Thanks for your contribution
@swift-server-bot test this please |
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.
Just caught a minor issue
} else { | ||
// remote | ||
const buildDirectory = buildDirectoryFromWorkspacePath(workspaceFolder, true); | ||
return path.join(buildDirectory, "checkouts", dependency.subpath); |
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.
Package path is used for different things, based on the kind of dependency you have. Remote dependencies store the web address of the repo in there so the View Repository
item in the right click menu works. You can either resurrect this setup or add a location
parameter to PackageNode
which stores the repo URL (Your call). If you add the location
parameter you will need to change the code for openInExternalEditor
in commands.ts to use this parameter.
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.
Thank you!
let me add a location
Do we show View Repository
for editing packages?
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.
Not at the moment, but if we have a separate parameter we could.
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.
I've fixed it in 8d7b216
About I have read the code of
(ideally spm should not change it may be not a problem for engineers for showing the unused dependencies |
Hmmm. I didn't realise remote dependencies weren't removed from the We could delete the workspace-state.json but that could have unintended consequences. |
local dependencies are the same case
That's the reason I think we should traverse all the dependencies without changing the time complexity is O(n). and if we can handle the file change event well. there should be no problem in performance.
This is true, and the file watchers might need to be organized again. |
Traversing all the dependencies could be expensive (Vapor projects have over 20 dependencies). Also there are some large packages out there. It is frustrating we would have to repeat the work that SwiftPM has already done. |
the cost is linear time, I'm not sure the performance of so we get two solutions.
Which one do you prefer? |
Well what we have on By the way I have packages where running |
Please check this one. here should cover all cases |
hmm, not very sure what it's doing inside |
Changes
workspace-state.json
Packages
orcustom local path
, originally it was still loaded from.build/checkouts
after ranswift package edit xxx
Note
getRemotePackages
,getLocalPackages
,getEditPackages
,editing
rather than displayingversion
.Do you prefer I fix it in this PR or create another PR (I need to read
baseOn
node from the json and probably showing likeediting 2.3.1
may be better)