Skip to content

Commit eefe7b9

Browse files
committed
move readme and changelog props to IExtension
1 parent c66ac03 commit eefe7b9

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

src/vs/platform/extensionManagement/common/extensionManagement.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,11 @@ export interface IGalleryMetadata {
9191
}
9292

9393
export interface ILocalExtension extends IExtension {
94-
readonly manifest: IExtensionManifest;
9594
isMachineScoped: boolean;
9695
publisherId: string | null;
9796
publisherDisplayName: string | null;
98-
readmeUrl: URI | null;
99-
changelogUrl: URI | null;
10097
}
10198

102-
export const IExtensionManagementService = createDecorator<IExtensionManagementService>('extensionManagementService');
103-
export const IExtensionGalleryService = createDecorator<IExtensionGalleryService>('extensionGalleryService');
104-
10599
export const enum SortBy {
106100
NoneOrRelevance = 0,
107101
LastUpdatedDate = 1,
@@ -148,6 +142,7 @@ export interface ITranslation {
148142
contents: { [key: string]: {} };
149143
}
150144

145+
export const IExtensionGalleryService = createDecorator<IExtensionGalleryService>('extensionGalleryService');
151146
export interface IExtensionGalleryService {
152147
readonly _serviceBrand: undefined;
153148
isEnabled(): boolean;
@@ -195,6 +190,7 @@ export class ExtensionManagementError extends Error {
195190
}
196191
}
197192

193+
export const IExtensionManagementService = createDecorator<IExtensionManagementService>('extensionManagementService');
198194
export interface IExtensionManagementService {
199195
readonly _serviceBrand: undefined;
200196

src/vs/platform/extensionManagement/node/extensionsScanner.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,9 @@ export class ExtensionsScanner extends Disposable {
228228
const children = await pfs.readdir(extensionPath);
229229
const { manifest, metadata } = await this.readManifest(extensionPath);
230230
const readme = children.filter(child => /^readme(\.txt|\.md|)$/i.test(child))[0];
231-
const readmeUrl = readme ? URI.file(path.join(extensionPath, readme)) : null;
231+
const readmeUrl = readme ? URI.file(path.join(extensionPath, readme)) : undefined;
232232
const changelog = children.filter(child => /^changelog(\.txt|\.md|)$/i.test(child))[0];
233-
const changelogUrl = changelog ? URI.file(path.join(extensionPath, changelog)) : null;
233+
const changelogUrl = changelog ? URI.file(path.join(extensionPath, changelog)) : undefined;
234234
const identifier = { id: getGalleryExtensionId(manifest.publisher, manifest.name) };
235235
const local = <ILocalExtension>{ type, identifier, manifest, location: URI.file(extensionPath), readmeUrl, changelogUrl, publisherDisplayName: null, publisherId: null, isMachineScoped: false };
236236
if (metadata) {

src/vs/platform/extensions/common/extensions.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ export interface IExtension {
175175
readonly identifier: IExtensionIdentifier;
176176
readonly manifest: IExtensionManifest;
177177
readonly location: URI;
178+
readonly readmeUrl?: URI;
179+
readonly changelogUrl?: URI;
178180
}
179181

180182
/**

0 commit comments

Comments
 (0)