You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Hello @dschaefer2! I just got pinged with this thread. It's an interesting idea!
@finestructure and I run the Swift Package Index and we'd certainly rather be involved early with any plans you have. Would it be worth having a chat? Our Discord is probably the best place to say hi and we can start up a DM conversation or quick call there.
Thanks! Yeah, this could be really cool. I'm just thinking of ways of making the Package manifest easier to work with. I'm probably not the one that's going to be working on this though. I know @daveyc123 was taking a peak at it, or he may have someone else in mind.
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.
The text was updated successfully, but these errors were encountered: