Merge from vscode fb5dc0083bfa9a0e3da7ed1f86e1ecb9836fcc8b

This commit is contained in:
ADS Merger
2020-03-13 05:35:18 +00:00
parent 7658a5df28
commit a7e56d334f
88 changed files with 1627 additions and 553 deletions

View File

@@ -419,7 +419,7 @@ registerEditorAction(class ShowLensesInCurrentLine extends EditorAction {
super({
id: 'codelens.showLensesInCurrentLine',
precondition: EditorContextKeys.hasCodeLensProvider,
label: localize('showLensOnLine', "Show Code Lens Command For Current Line"),
label: localize('showLensOnLine', "Show Code Lens Commands For Current Line"),
alias: 'Show Code Lens Commands For Current Line',
});
}

View File

@@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { AbstractCommandsQuickAccessProvider, ICommandQuickPick, ICommandsQuickAccessOptions } from 'vs/platform/quickinput/browser/commandsQuickAccess';
import { IEditor } from 'vs/editor/common/editorCommon';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { ICommandService } from 'vs/platform/commands/common/commands';
export abstract class AbstractEditorCommandsQuickAccessProvider extends AbstractCommandsQuickAccessProvider {
constructor(
options: ICommandsQuickAccessOptions,
instantiationService: IInstantiationService,
keybindingService: IKeybindingService,
commandService: ICommandService,
telemetryService: ITelemetryService,
notificationService: INotificationService
) {
super(options, instantiationService, keybindingService, commandService, telemetryService, notificationService);
}
/**
* Subclasses to provide the current active editor control.
*/
abstract activeTextEditorControl: IEditor | undefined;
protected getCodeEditorCommandPicks(): ICommandQuickPick[] {
const activeTextEditorControl = this.activeTextEditorControl;
if (!activeTextEditorControl) {
return [];
}
const editorCommandPicks: ICommandQuickPick[] = [];
for (const editorAction of activeTextEditorControl.getSupportedActions()) {
editorCommandPicks.push({
commandId: editorAction.id,
commandAlias: editorAction.alias,
label: editorAction.label || editorAction.id,
});
}
return editorCommandPicks;
}
}