Skip to content

Commit 77d3104

Browse files
LuisUrrutiashanalikhan
authored andcommitted
fix: remove gallery installation check
1 parent b4bdc4e commit 77d3104

File tree

1 file changed

+22
-26
lines changed

1 file changed

+22
-26
lines changed

src/service/pluginService.ts

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import * as util from "../util";
99
const apiPath =
1010
"https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery";
1111

12-
const extensionDir: string = ".vscode/";
13-
const extensionDirPortable: string = "/extensions/";
1412

1513
export class ExtensionInformation {
1614
public static fromJSON(text: string) {
@@ -160,31 +158,29 @@ export class PluginService {
160158
for (const ext of vscode.extensions.all) {
161159
console.log(ext.extensionPath);
162160

163-
if (
164-
(ext.extensionPath.includes(extensionDir) ||
165-
ext.extensionPath.includes(extensionDirPortable)) && // skip if not install from gallery
166-
ext.packageJSON.isBuiltin === false
167-
) {
168-
const meta = ext.packageJSON.__metadata || {
169-
id: ext.packageJSON.uuid,
170-
publisherId: ext.id,
171-
publisherDisplayName: ext.packageJSON.publisher
172-
};
173-
const data = new ExtensionMetadata(
174-
meta.galleryApiUrl,
175-
meta.id,
176-
meta.downloadUrl,
177-
meta.publisherId,
178-
meta.publisherDisplayName,
179-
meta.date
180-
);
181-
const info = new ExtensionInformation();
182-
info.metadata = data;
183-
info.name = ext.packageJSON.name;
184-
info.publisher = ext.packageJSON.publisher;
185-
info.version = ext.packageJSON.version;
186-
list.push(info);
161+
if (ext.packageJSON.isBuiltin === true) {
162+
continue;
187163
}
164+
165+
const meta = ext.packageJSON.__metadata || {
166+
id: ext.packageJSON.uuid,
167+
publisherId: ext.id,
168+
publisherDisplayName: ext.packageJSON.publisher
169+
};
170+
const data = new ExtensionMetadata(
171+
meta.galleryApiUrl,
172+
meta.id,
173+
meta.downloadUrl,
174+
meta.publisherId,
175+
meta.publisherDisplayName,
176+
meta.date
177+
);
178+
const info = new ExtensionInformation();
179+
info.metadata = data;
180+
info.name = ext.packageJSON.name;
181+
info.publisher = ext.packageJSON.publisher;
182+
info.version = ext.packageJSON.version;
183+
list.push(info);
188184
}
189185

190186
return list;

0 commit comments

Comments
 (0)