mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-19 14:22:19 +01:00
@@ -12,7 +12,7 @@ import { Platform } from '../../../base/common/platform.js';
|
||||
import { URI } from '../../../base/common/uri.js';
|
||||
import { localize2 } from '../../../nls.js';
|
||||
import { ExtensionType, IExtension, IExtensionManifest, TargetPlatform } from '../../extensions/common/extensions.js';
|
||||
import { IFileService } from '../../files/common/files.js';
|
||||
import { FileOperationError, FileOperationResult, IFileService, IFileStat } from '../../files/common/files.js';
|
||||
import { createDecorator } from '../../instantiation/common/instantiation.js';
|
||||
|
||||
export const EXTENSION_IDENTIFIER_PATTERN = '^([a-z0-9A-Z][a-z0-9-A-Z]*)\\.([a-z0-9A-Z][a-z0-9-A-Z]*)$';
|
||||
@@ -640,7 +640,15 @@ export interface IAllowedExtensionsService {
|
||||
}
|
||||
|
||||
export async function computeSize(location: URI, fileService: IFileService): Promise<number> {
|
||||
const stat = await fileService.resolve(location);
|
||||
let stat: IFileStat;
|
||||
try {
|
||||
stat = await fileService.resolve(location);
|
||||
} catch (e) {
|
||||
if ((<FileOperationError>e).fileOperationResult === FileOperationResult.FILE_NOT_FOUND) {
|
||||
return 0;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
if (stat.children) {
|
||||
const sizes = await Promise.all(stat.children.map(c => computeSize(c.resource, fileService)));
|
||||
return sizes.reduce((r, s) => r + s, 0);
|
||||
|
||||
@@ -1157,12 +1157,14 @@ class AdditionalDetailsWidget extends Disposable {
|
||||
$('div.more-info-entry-name', undefined, localize('id', "Identifier")),
|
||||
$('code', undefined, extension.identifier.id)
|
||||
));
|
||||
append(installInfo,
|
||||
$('.more-info-entry', undefined,
|
||||
$('div.more-info-entry-name', undefined, localize('Version', "Version")),
|
||||
$('code', undefined, extension.manifest.version)
|
||||
)
|
||||
);
|
||||
if (extension.type !== ExtensionType.System) {
|
||||
append(installInfo,
|
||||
$('.more-info-entry', undefined,
|
||||
$('div.more-info-entry-name', undefined, localize('Version', "Version")),
|
||||
$('code', undefined, extension.manifest.version)
|
||||
)
|
||||
);
|
||||
}
|
||||
if (extension.installedTimestamp) {
|
||||
append(installInfo,
|
||||
$('.more-info-entry', undefined,
|
||||
@@ -1171,7 +1173,7 @@ class AdditionalDetailsWidget extends Disposable {
|
||||
)
|
||||
);
|
||||
}
|
||||
if (extension.source !== 'gallery') {
|
||||
if (!extension.isBuiltin && extension.source !== 'gallery') {
|
||||
const element = $('div', undefined, extension.source === 'vsix' ? localize('vsix', "VSIX") : localize('other', "Local"));
|
||||
append(installInfo,
|
||||
$('.more-info-entry', undefined,
|
||||
|
||||
Reference in New Issue
Block a user