vscode-swift icon indicating copy to clipboard operation
vscode-swift copied to clipboard

Locally edited packages in `Packages` folder should be listed

Open adam-fowler opened this issue 3 years ago • 3 comments

Currently they are not because the workspace.json file doesn't include a path for them. We can work this out though from the subpath member ie they are inside the Packages folder

adam-fowler avatar Jul 24 '22 09:07 adam-fowler

I don't quite understand the edited packages, Could you please share more about it

aelam avatar Jul 24 '22 14:07 aelam

swift package edit allows you to edit the code in dependencies. You can either use a local version of the dependency somewhere else on your file system or have it create a copy of the dependency in the Packages folder. Currently the extension supports the first case, right click on the extension and chose use local version. You can still use the second version but have to type swift package edit my-dependency outside of vscode. The problem is when you do this the dependency is removed from the dependency view.

adam-fowler avatar Jul 24 '22 15:07 adam-fowler

Thank s for your answer!

You can either use a local version of the dependency somewhere else on your file system or have it create a copy of the dependency in the Packages folder.

Just tried swift package edit, and it seems not much difference for in Packages folder or not, an alias would be created

I'm trying to learning the code and fixing it

Is it like this? I tested it with Packages folder, it works well

3333

When I read the code I got three points that I'd like to share

  • it seems thatworkspace.json is all needed for dependency list.
  • more status can be introduced like resolving, fetching.
  • PackageNode should be prepared before it's used otherwise there would be a lot of conditional checks for paths
  • current type: local, remote, editing seems to make two types into one type to control local/remote is a pair edited, not_edited is a pair

#370

aelam avatar Jul 24 '22 17:07 aelam