@@ -109,7 +109,9 @@ type Storage interface {
109
109
// FileServer provides a handler for fetching extension repository files from
110
110
// a client.
111
111
FileServer () http.Handler
112
- // Manifest returns the manifest for the provided extension version.
112
+ // Manifest returns the manifest for the provided extension version. The
113
+ // extension asset (the VSIX) will always be added even if it does not exist
114
+ // in the manifest on disk.
113
115
Manifest (ctx context.Context , publisher , extension , version string ) (* VSIXManifest , error )
114
116
// WalkExtensions applies a function over every extension providing the
115
117
// manifest for the latest version and a list of all available versions. If
@@ -128,18 +130,6 @@ func parseVSIXManifest(reader io.Reader) (*VSIXManifest, error) {
128
130
return nil , err
129
131
}
130
132
131
- // The extension asset is not stored in the manifest. Since we always store
132
- // it next to the manifest using the publisher.name-version format we can set
133
- // that as the path.
134
- vm .Assets .Asset = append (vm .Assets .Asset , VSIXAsset {
135
- Type : VSIXAssetType ,
136
- Path : fmt .Sprintf ("%s.%s-%s.vsix" ,
137
- vm .Metadata .Identity .Publisher ,
138
- vm .Metadata .Identity .ID ,
139
- vm .Metadata .Identity .Version ),
140
- Addressable : "true" ,
141
- })
142
-
143
133
return vm , nil
144
134
}
145
135
@@ -183,3 +173,11 @@ func ReadVSIX(ctx context.Context, source string) ([]byte, error) {
183
173
N : 100 * 1000 * 1000 , // 100 MB
184
174
})
185
175
}
176
+
177
+ // extensionID returns the full ID of an extension.
178
+ func extensionID (manifest * VSIXManifest ) string {
179
+ return fmt .Sprintf ("%s.%s-%s" ,
180
+ manifest .Metadata .Identity .Publisher ,
181
+ manifest .Metadata .Identity .ID ,
182
+ manifest .Metadata .Identity .Version )
183
+ }
0 commit comments