swiftlang / vscode-swift

Visual Studio Code Extension for Swift
https://marketplace.visualstudio.com/items?itemName=sswg.swift-lang
Apache License 2.0
708 stars 47 forks source link

[DO NOT MERGE] Prototype for SPI integration #809

Open daveyc123 opened 1 month ago

daveyc123 commented 1 month ago

This change is a prototype for SPI integration. It provides two new commands that leverage the new add package workflows within swiftpm

Add package is fairly straight forward. It prompts the user for both the package URL and the version, and adds the package to their Package.swift (by calling swift package add...). An alternative here would be to have the LSP do the equivalent refactoring operation.

Browse Package Index opens a webview to the SPI (note in this patch it's using localhost) in an iframe. The intent is that the SPI can detect that it is running through the vscode webview and provide alternative UI for adding a package. This is accomplished through:

[1] - SPI usage

daveyc123 commented 1 month ago

@finestructure @daveverwer

daveyc123 commented 1 month ago

Thought I'd try and get this running but nothing shows up 😞 when I run browsePackageIndex

Unfortunately it won't be functional until SPI has added support

adam-fowler commented 1 month ago

But @daveyc123 it didn't even show the SPI website.

daveyc123 commented 1 month ago

But @daveyc123 it didn't even show the SPI website.

In the patch it's pointing to localhost so that it can be tested against a locally running SPI with the appropriate changes.