mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-22 21:00:30 -04:00
Merge from vscode fb5dc0083bfa9a0e3da7ed1f86e1ecb9836fcc8b
This commit is contained in:
@@ -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',
|
||||
});
|
||||
}
|
||||
|
||||
49
src/vs/editor/contrib/quickAccess/commandsQuickAccess.ts
Normal file
49
src/vs/editor/contrib/quickAccess/commandsQuickAccess.ts
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user