@@ -12,8 +12,6 @@ import (
1212"golang.org/x/xerrors"
1313)
1414
15- const VSIXAssetType = "Microsoft.VisualStudio.Services.VSIXPackage"
16-
1715// VSIXManifest implement XMLManifest.PackageManifest.
1816// https://github.com/microsoft/vscode-vsce/blob/main/src/xml.ts#L9-L26
1917type VSIXManifest struct {
@@ -57,11 +55,18 @@ type VSIXProperties struct {
5755Property []VSIXProperty
5856}
5957
58+ type PropertyType string
59+
60+ const (
61+ DependencyPropertyType PropertyType = "Microsoft.VisualStudio.Code.ExtensionDependencies"
62+ PackPropertyType PropertyType = "Microsoft.VisualStudio.Code.ExtensionPack"
63+ )
64+
6065// VSIXProperty implements XMLManifest.PackageManifest.Metadata.Properties.Property.
6166// https://github.com/microsoft/vscode-vsce/blob/main/src/xml.ts#L19
6267type VSIXProperty struct {
63- ID string `xml:"Id,attr"`
64- Value string `xml:",attr"`
68+ ID PropertyType `xml:"Id,attr"`
69+ Value string `xml:",attr"`
6570}
6671
6772// VSIXAssets implements XMLManifest.PackageManifest.Assets.
@@ -70,20 +75,33 @@ type VSIXAssets struct {
7075Asset []VSIXAsset
7176}
7277
78+ type AssetType string
79+
80+ const (
81+ VSIXAssetType AssetType = "Microsoft.VisualStudio.Services.VSIXPackage"
82+ )
83+
7384// VSIXAsset implements XMLManifest.PackageManifest.Assets.Asset.
7485// https://github.com/microsoft/vscode-vsce/blob/main/src/xml.ts#L25
7586type VSIXAsset struct {
76- Type string `xml:",attr"`
77- Path string `xml:",attr"`
78- Addressable string `xml:",attr"`
87+ Type AssetType `xml:",attr"`
88+ Path string `xml:",attr"`
89+ Addressable string `xml:",attr"`
90+ }
91+
92+ type Extension struct {
93+ ID string
94+ Location string
95+ Dependencies []string
96+ Pack []string
7997}
8098
8199// TODO: Add Artifactory implementation of Storage.
82100type Storage interface {
83101// AddExtension adds the extension found at the specified source by copying it
84- // into the extension storage directory and returns the location of the new
102+ // into the extension storage directory and returns details about the added
85103// extension. The source may be an URI or a local file path.
86- AddExtension (ctx context.Context , source string ) (string , error )
104+ AddExtension (ctx context.Context , source string ) (* Extension , error )
87105// FileServer provides a handler for fetching extension repository files from
88106// a client.
89107FileServer () http.Handler
0 commit comments