Description
The Swift Package Index is a valuable resource for discovering gems in the Swift package ecosystem. The index web site has a cool feature that gives you code snippets that you can paste into your Package.swift to hook up the dependencies. It would be a great productivity enhancer if we could leverage the index with automations in VSCode with the help of sourcekit-lsp to discover and add these dependencies.
A potential solution would be to add a command that opens the Swift Package Index website in webview. We can inject Javascript into these pages to make the necessary calls to allow sourcekit-lsp to add dependencies to the package with the right URL and and version. swiftlang/sourcekit-lsp#1193 provides an example on how this could be done.
From there, there are two options to hook up the UI. We could inject HTML buttons and action code in the "Use this package" dialog. The better option is to work with the SPI team to add this code to the pages directly, detecting whether vscode was present and making the calls there.
The index also provides snippets for adding the target dependencies. I think that would better be done in the language server as the user is adding the target so I don't believe automation around that part of the index UI would be necessary. The user can still use the current Copy function there to add those manually in the meantime.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status