Hi all,
I’d like to pitch a change to the VS Code Swift Extension’s dependency panel, evolving it into more of a Project Panel that provides a higher level view of your project. Please let me know if you have any questions or thoughts!
Introduction/Motivation
Currently, access to your package targets, dependencies, commands and tasks are spread between the command palette and the dependencies panel. This makes it hard to tell at a glance all the targets, tasks and commands that are available. I’d like to provide a more centralized view of the targets and dependencies that make up your project.
Proposed Solution
The project panel would be a tree view with four top level nodes:
Dependencies
Currently the package dependencies panel is a tree view of dependencies which includes all dependencies-of-dependencies in a flat list. This makes it hard to tell what dependencies are defined by the user in the root Package.swift, and what dependencies are included transitively.
In the Project Panel the dependencies list would become hierarchal so the top level is a list of dependencies that you have defined in the Package.swift, and drilling down shows what dependencies are included by which parent. Dependencies would still have their filesystem contents listed under their tree node (not shown in the mockup screenshot).
The functionality to edit dependencies as well as trigger swift package resolve
from the panel would stay unchanged.
Targets
Entries under the Targets top level node would enumerate the targets defined in your Package.swift. Expanding an individual target would show:
- A dependency list for dependencies of the target
- A button to run/debug the target the target is executable
- A button to run the target’s tests (if there are any test targets that include this target as a dependency)
Tasks
The tasks entry would show a list of both the synthesized tasks provided by the extension such as Build All, and any user defined tasks in their .vscode/tasks.json. The goal is to make it easier for users to build and debug with their custom tasks.
Commands
If your package or a dependency defines any runnable commands they would appear under the commands list. This would essentially be a mirror of the list in > Swift: Run Command Plugin
, and would allow command plugins to be run directly from the panel.
These changes wouldn't necessarily need to land all at once; they could be staged as incremental changes to the existing Project Dependencies panel, first building out the "dependencies" tree node and then adding on targets, tasks and commands.
This is a high level view of where I'd like to take things, please let me know if you have any use cases or improvements you'd like to see.