mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
* Use notification prompt before running a command https://github.com/microsoft/vscode/pull/179702/commits * Removes unused declarations
This commit is contained in:
@@ -27,6 +27,7 @@ import { IOpenerService } from 'vs/platform/opener/common/opener';
|
|||||||
import { IGenericMarkProperties } from 'vs/platform/terminal/common/terminalProcess';
|
import { IGenericMarkProperties } from 'vs/platform/terminal/common/terminalProcess';
|
||||||
import { IQuickInputService, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput';
|
import { IQuickInputService, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput';
|
||||||
import { Codicon } from 'vs/base/common/codicons';
|
import { Codicon } from 'vs/base/common/codicons';
|
||||||
|
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
|
||||||
|
|
||||||
const enum DecorationSelector {
|
const enum DecorationSelector {
|
||||||
CommandDecoration = 'terminal-command-decoration',
|
CommandDecoration = 'terminal-command-decoration',
|
||||||
@@ -68,7 +69,8 @@ export class DecorationAddon extends Disposable implements ITerminalAddon {
|
|||||||
@IConfigurationService private readonly _configurationService: IConfigurationService,
|
@IConfigurationService private readonly _configurationService: IConfigurationService,
|
||||||
@IThemeService private readonly _themeService: IThemeService,
|
@IThemeService private readonly _themeService: IThemeService,
|
||||||
@IOpenerService private readonly _openerService: IOpenerService,
|
@IOpenerService private readonly _openerService: IOpenerService,
|
||||||
@IQuickInputService private readonly _quickInputService: IQuickInputService
|
@IQuickInputService private readonly _quickInputService: IQuickInputService,
|
||||||
|
@INotificationService private readonly _notificationService: INotificationService
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
this._register(toDisposable(() => this._dispose()));
|
this._register(toDisposable(() => this._dispose()));
|
||||||
@@ -408,7 +410,15 @@ export class DecorationAddon extends Disposable implements ITerminalAddon {
|
|||||||
const labelRun = localize("terminal.rerunCommand", 'Rerun Command');
|
const labelRun = localize("terminal.rerunCommand", 'Rerun Command');
|
||||||
actions.push({
|
actions.push({
|
||||||
class: undefined, tooltip: labelRun, dispose: () => { }, id: 'terminal.rerunCommand', label: labelRun, enabled: true,
|
class: undefined, tooltip: labelRun, dispose: () => { }, id: 'terminal.rerunCommand', label: labelRun, enabled: true,
|
||||||
|
run: async () => {
|
||||||
|
this._notificationService.prompt(Severity.Info, localize('rerun', 'Do you want to run the command: {0}', command.command), [{
|
||||||
|
label: localize('yes', 'Yes'),
|
||||||
run: () => this._onDidRequestRunCommand.fire({ command })
|
run: () => this._onDidRequestRunCommand.fire({ command })
|
||||||
|
}, {
|
||||||
|
label: localize('no', 'No'),
|
||||||
|
run: () => { }
|
||||||
|
}]);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
const labelCopy = localize("terminal.copyCommand", 'Copy Command');
|
const labelCopy = localize("terminal.copyCommand", 'Copy Command');
|
||||||
actions.push({
|
actions.push({
|
||||||
|
|||||||
Reference in New Issue
Block a user