Merge branch 'main' into joh/vscode-dts
This commit is contained in:
commit
f161c7edf0
|
@ -8,7 +8,7 @@ let err = false;
|
|||
const majorNodeVersion = parseInt(/^(\d+)\./.exec(process.versions.node)[1]);
|
||||
|
||||
if (majorNodeVersion < 14 || majorNodeVersion >= 17) {
|
||||
console.error('\033[1;31m*** Please use node.js versions >=14 and <=17.\033[0;0m');
|
||||
console.error('\033[1;31m*** Please use node.js versions >=14 and <17.\033[0;0m');
|
||||
err = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -87,6 +87,8 @@ export abstract class AbstractExtensionManagementService extends Disposable impl
|
|||
try {
|
||||
return await this.doInstallFromGallery(extension, options);
|
||||
} catch (error) {
|
||||
this.logService.error(`Failed to install extension.`, extension.identifier.id);
|
||||
this.logService.error(error);
|
||||
throw toExtensionManagementError(error);
|
||||
}
|
||||
}
|
||||
|
@ -134,7 +136,6 @@ export abstract class AbstractExtensionManagementService extends Disposable impl
|
|||
if (!await this.canInstall(extension)) {
|
||||
const targetPlatform = await this.getTargetPlatform();
|
||||
const error = new ExtensionManagementError(nls.localize('incompatible platform', "The '{0}' extension is not available in {1} for {2}.", extension.identifier.id, this.productService.nameLong, TargetPlatformToString(targetPlatform)), ExtensionManagementErrorCode.Incompatible);
|
||||
this.logService.error(`Cannot install extension.`, extension.identifier.id, error.message);
|
||||
reportTelemetry(this.telemetryService, 'extensionGallery:install', getGalleryExtensionTelemetryData(extension), undefined, error);
|
||||
throw error;
|
||||
}
|
||||
|
@ -142,7 +143,6 @@ export abstract class AbstractExtensionManagementService extends Disposable impl
|
|||
try {
|
||||
extension = await this.checkAndGetCompatibleVersion(extension, !options.installGivenVersion);
|
||||
} catch (error) {
|
||||
this.logService.error(getErrorMessage(error));
|
||||
reportTelemetry(this.telemetryService, 'extensionGallery:install', getGalleryExtensionTelemetryData(extension), undefined, error);
|
||||
throw error;
|
||||
}
|
||||
|
@ -150,14 +150,12 @@ export abstract class AbstractExtensionManagementService extends Disposable impl
|
|||
const manifest = await this.galleryService.getManifest(extension, CancellationToken.None);
|
||||
if (manifest === null) {
|
||||
const error = new ExtensionManagementError(`Missing manifest for extension ${extension.identifier.id}`, ExtensionManagementErrorCode.Invalid);
|
||||
this.logService.error(`Failed to install extension:`, extension.identifier.id, error.message);
|
||||
reportTelemetry(this.telemetryService, 'extensionGallery:install', getGalleryExtensionTelemetryData(extension), undefined, error);
|
||||
throw error;
|
||||
}
|
||||
|
||||
if (manifest.version !== extension.version) {
|
||||
const error = new ExtensionManagementError(`Cannot install '${extension.identifier.id}' extension because of version mismatch in Marketplace`, ExtensionManagementErrorCode.Invalid);
|
||||
this.logService.error(error.message);
|
||||
reportTelemetry(this.telemetryService, 'extensionGallery:install', getGalleryExtensionTelemetryData(extension), undefined, error);
|
||||
throw error;
|
||||
}
|
||||
|
@ -217,7 +215,6 @@ export abstract class AbstractExtensionManagementService extends Disposable impl
|
|||
}
|
||||
} else {
|
||||
this.logService.error('Error while preparing to install dependencies and extension packs of the extension:', installExtensionTask.identifier.id);
|
||||
this.logService.error(error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
@ -261,7 +258,6 @@ export abstract class AbstractExtensionManagementService extends Disposable impl
|
|||
reportTelemetry(this.telemetryService, task.operation === InstallOperation.Update ? 'extensionGallery:update' : 'extensionGallery:install', getGalleryExtensionTelemetryData(task.source), new Date().getTime() - startTime, error);
|
||||
}
|
||||
this.logService.error('Error while installing the extension:', task.identifier.id);
|
||||
this.logService.error(error);
|
||||
throw error;
|
||||
} finally { extensionsToInstallMap.delete(task.identifier.id.toLowerCase()); }
|
||||
}));
|
||||
|
@ -295,12 +291,7 @@ export abstract class AbstractExtensionManagementService extends Disposable impl
|
|||
}
|
||||
}
|
||||
|
||||
this.logService.error(`Failed to install extension:`, installExtensionTask.identifier.id, getErrorMessage(error));
|
||||
this._onDidInstallExtensions.fire(allInstallExtensionTasks.map(({ task }) => ({ identifier: task.identifier, operation: InstallOperation.Install, source: task.source })));
|
||||
|
||||
if (error instanceof Error) {
|
||||
error.name = error && (<ExtensionManagementError>error).code ? (<ExtensionManagementError>error).code : ExtensionManagementErrorCode.Internal;
|
||||
}
|
||||
throw error;
|
||||
} finally {
|
||||
/* Remove the gallery tasks from the cache */
|
||||
|
|
|
@ -10,7 +10,7 @@ export interface IKeyboardMapper {
|
|||
dumpDebugInfo(): string;
|
||||
resolveKeybinding(keybinding: Keybinding): ResolvedKeybinding[];
|
||||
resolveKeyboardEvent(keyboardEvent: IKeyboardEvent): ResolvedKeybinding;
|
||||
resolveUserBinding(firstPart: (SimpleKeybinding | ScanCodeBinding)[]): ResolvedKeybinding[];
|
||||
resolveUserBinding(parts: (SimpleKeybinding | ScanCodeBinding)[]): ResolvedKeybinding[];
|
||||
}
|
||||
|
||||
export class CachedKeyboardMapper implements IKeyboardMapper {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as glob from 'vs/base/common/glob';
|
||||
import { GroupIdentifier, ISaveOptions, IMoveResult, IRevertOptions, EditorInputCapabilities, Verbosity, IUntypedEditorInput, isResourceDiffEditorInput, isResourceSideBySideEditorInput } from 'vs/workbench/common/editor';
|
||||
import { GroupIdentifier, ISaveOptions, IMoveResult, IRevertOptions, EditorInputCapabilities, Verbosity, IUntypedEditorInput } from 'vs/workbench/common/editor';
|
||||
import { EditorInput } from 'vs/workbench/common/editor/editorInput';
|
||||
import { INotebookService, SimpleNotebookProviderInfo } from 'vs/workbench/contrib/notebook/common/notebookService';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
|
@ -13,7 +13,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
|||
import { IFileDialogService } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { INotebookEditorModelResolverService } from 'vs/workbench/contrib/notebook/common/notebookEditorModelResolverService';
|
||||
import { IDisposable, IReference } from 'vs/base/common/lifecycle';
|
||||
import { CellEditType, CellUri, IResolvedNotebookEditorModel } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
||||
import { CellEditType, IResolvedNotebookEditorModel } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
||||
import { ILabelService } from 'vs/platform/label/common/label';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { mark } from 'vs/workbench/contrib/notebook/common/notebookPerformance';
|
||||
|
@ -285,12 +285,6 @@ export class NotebookEditorInput extends AbstractResourceEditorInput {
|
|||
if (otherInput instanceof NotebookEditorInput) {
|
||||
return this.viewType === otherInput.viewType && isEqual(this.resource, otherInput.resource);
|
||||
}
|
||||
if (isResourceDiffEditorInput(otherInput) || isResourceSideBySideEditorInput(otherInput)) {
|
||||
return false;
|
||||
}
|
||||
if (otherInput.resource && otherInput.resource.scheme === Schemas.vscodeNotebookCell) {
|
||||
return isEqual(this.resource, CellUri.parse(otherInput.resource)?.notebook);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import * as dom from 'vs/base/browser/dom';
|
|||
import { printKeyboardEvent, printStandardKeyboardEvent, StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
import { IJSONSchema } from 'vs/base/common/jsonSchema';
|
||||
import { KeyCode, KeyMod, ScanCode, ScanCodeUtils, IMMUTABLE_CODE_TO_KEY_CODE } from 'vs/base/common/keyCodes';
|
||||
import { KeyCode, KeyMod, ScanCode, ScanCodeUtils, IMMUTABLE_CODE_TO_KEY_CODE, KeyCodeUtils } from 'vs/base/common/keyCodes';
|
||||
import { Keybinding, ResolvedKeybinding, SimpleKeybinding, ScanCodeBinding } from 'vs/base/common/keybindings';
|
||||
import { KeybindingParser } from 'vs/base/common/keybindingParser';
|
||||
import { OS, OperatingSystem, isMacintosh } from 'vs/base/common/platform';
|
||||
|
@ -51,6 +51,7 @@ import { ILogService } from 'vs/platform/log/common/log';
|
|||
import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
|
||||
import { dirname } from 'vs/base/common/resources';
|
||||
import { getAllUnboundCommands } from 'vs/workbench/services/keybinding/browser/unboundCommands';
|
||||
import { UserSettingsLabelProvider } from 'vs/base/common/keybindingLabels';
|
||||
|
||||
interface ContributedKeyBinding {
|
||||
command: string;
|
||||
|
@ -338,11 +339,82 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
|
|||
updateSchema(flatten(this._contributions.map(x => x.getSchemaAdditions())));
|
||||
}
|
||||
|
||||
private _printUserBinding(parts: (SimpleKeybinding | ScanCodeBinding)[]): string {
|
||||
return UserSettingsLabelProvider.toLabel(OS, parts, (part) => {
|
||||
if (part instanceof SimpleKeybinding) {
|
||||
return KeyCodeUtils.toString(part.keyCode);
|
||||
}
|
||||
return ScanCodeUtils.toString(part.scanCode);
|
||||
}) || '[null]';
|
||||
}
|
||||
|
||||
private _printResolvedKeybinding(resolvedKeybinding: ResolvedKeybinding): string {
|
||||
return resolvedKeybinding.getDispatchParts().map(x => x || '[null]').join(' ');
|
||||
}
|
||||
|
||||
private _printResolvedKeybindings(output:string[], input: string, resolvedKeybindings: ResolvedKeybinding[]): void {
|
||||
const padLength = 35;
|
||||
const firstRow = `${input.padStart(padLength, ' ')} => `;
|
||||
if (resolvedKeybindings.length === 0) {
|
||||
// no binding found
|
||||
output.push(`${firstRow}${'[NO BINDING]'.padStart(padLength, ' ')}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const firstRowIndentation = firstRow.length;
|
||||
let isFirst = true;
|
||||
for (const resolvedKeybinding of resolvedKeybindings) {
|
||||
if (isFirst) {
|
||||
output.push(`${firstRow}${this._printResolvedKeybinding(resolvedKeybinding).padStart(padLength, ' ')}`);
|
||||
} else {
|
||||
output.push(`${' '.repeat(firstRowIndentation)}${this._printResolvedKeybinding(resolvedKeybinding).padStart(padLength, ' ')}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private _dumpResolveKeybindingDebugInfo(): string {
|
||||
|
||||
const seenBindings = new Set<string>();
|
||||
const result: string[] = [];
|
||||
|
||||
result.push(`Default Resolved Keybindings (unique only):`);
|
||||
for (const item of KeybindingsRegistry.getDefaultKeybindings()) {
|
||||
if (!item.keybinding || item.keybinding.length === 0) {
|
||||
continue;
|
||||
}
|
||||
const input = this._printUserBinding(item.keybinding);
|
||||
if (seenBindings.has(input)) {
|
||||
continue;
|
||||
}
|
||||
seenBindings.add(input);
|
||||
const resolvedKeybindings = this._keyboardMapper.resolveUserBinding(item.keybinding);
|
||||
this._printResolvedKeybindings(result, input, resolvedKeybindings);
|
||||
}
|
||||
|
||||
result.push(`User Resolved Keybindings (unique only):`);
|
||||
for (const _item of this.userKeybindings.keybindings) {
|
||||
const item = KeybindingIO.readUserKeybindingItem(_item);
|
||||
if (!item.parts || item.parts.length === 0) {
|
||||
continue;
|
||||
}
|
||||
const input = _item.key;
|
||||
if (seenBindings.has(input)) {
|
||||
continue;
|
||||
}
|
||||
seenBindings.add(input);
|
||||
const resolvedKeybindings = this._keyboardMapper.resolveUserBinding(item.parts);
|
||||
this._printResolvedKeybindings(result, input, resolvedKeybindings);
|
||||
}
|
||||
|
||||
return result.join('\n');
|
||||
}
|
||||
|
||||
public _dumpDebugInfo(): string {
|
||||
const layoutInfo = JSON.stringify(this.keyboardLayoutService.getCurrentKeyboardLayout(), null, '\t');
|
||||
const mapperInfo = this._keyboardMapper.dumpDebugInfo();
|
||||
const resolvedKeybindings = this._dumpResolveKeybindingDebugInfo();
|
||||
const rawMapping = JSON.stringify(this.keyboardLayoutService.getRawKeyboardMapping(), null, '\t');
|
||||
return `Layout info:\n${layoutInfo}\n${mapperInfo}\n\nRaw mapping:\n${rawMapping}`;
|
||||
return `Layout info:\n${layoutInfo}\n\n${resolvedKeybindings}\n\n${mapperInfo}\n\nRaw mapping:\n${rawMapping}`;
|
||||
}
|
||||
|
||||
public _dumpDebugInfoJSON(): string {
|
||||
|
|
4
src/vscode-dts/vscode.proposed.d.ts
vendored
4
src/vscode-dts/vscode.proposed.d.ts
vendored
|
@ -1858,9 +1858,7 @@ declare module 'vscode' {
|
|||
}
|
||||
//#endregion
|
||||
|
||||
// TODO: @connor4312 split this up
|
||||
// eslint-disable-next-line vscode-dts-region-comments
|
||||
//#region proposed test APIs https://github.com/microsoft/vscode/issues/107467
|
||||
//#region testObserver: https://github.com/microsoft/vscode/issues/107467
|
||||
export namespace tests {
|
||||
/**
|
||||
* Requests that tests be run by their controller.
|
||||
|
|
Loading…
Reference in a new issue