提交 9cea4954 编写于 作者: B Benjamin Pasero

notifications 💄

上级 691951c3
......@@ -158,7 +158,7 @@ export class ContextMenuHandler {
}
private onDidActionRun(e: IRunEvent): void {
if (e.error && this.notificationService) {
if (e.error) {
this.notificationService.error(e.error);
}
}
......
......@@ -23,7 +23,6 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
import { CommandsRegistry, ICommandHandler } from 'vs/platform/commands/common/commands';
import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions';
import { ActiveGroupEditorsByMostRecentlyUsedQuickAccess } from 'vs/workbench/browser/parts/editor/editorQuickAccess';
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
import { IOpenerService } from 'vs/platform/opener/common/opener';
import { ITextEditorOptions } from 'vs/platform/editor/common/editor';
import { openEditorWith } from 'vs/workbench/services/editor/common/editorOpenWith';
......@@ -901,24 +900,10 @@ function registerOtherEditorCommands(): void {
id: TOGGLE_KEEP_EDITORS_COMMAND_ID,
handler: accessor => {
const configurationService = accessor.get(IConfigurationService);
const notificationService = accessor.get(INotificationService);
const openerService = accessor.get(IOpenerService);
// Update setting
const currentSetting = configurationService.getValue<boolean>('workbench.editor.enablePreview');
const newSetting = currentSetting === true ? false : true;
configurationService.updateValue('workbench.editor.enablePreview', newSetting);
// Inform user
notificationService.prompt(
Severity.Info,
newSetting ?
nls.localize('enablePreview', "Preview editors have been enabled in settings.") :
nls.localize('disablePreview', "Preview editors have been disabled in settings."),
[{
label: nls.localize('learnMore', "Learn More"), run: () => openerService.open('https://go.microsoft.com/fwlink/?linkid=2147473')
}]
);
}
});
......
......@@ -48,7 +48,7 @@ class DiffEditorHelperContribution extends Disposable implements IDiffEditorCont
Severity.Warning,
nls.localize('hintTimeout', "The diff algorithm was stopped early (after {0} ms.)", this._diffEditor.maxComputationTime),
[{
label: nls.localize('removeTimeout', "Remove limit"),
label: nls.localize('removeTimeout', "Remove Limit"),
run: () => {
this._configurationService.updateValue('diffEditor.maxComputationTime', 0);
}
......
......@@ -46,7 +46,7 @@ export class LargeFileOptimizationsWarner extends Disposable implements IEditorC
this._notificationService.prompt(Severity.Info, message, [
{
label: nls.localize('removeOptimizations', "Forcefully enable features"),
label: nls.localize('removeOptimizations', "Forcefully Enable Features"),
run: () => {
this._configurationService.updateValue(`editor.largeFileOptimizations`, false).then(() => {
this._notificationService.info(nls.localize('reopenFilePrompt', "Please reopen file in order for this setting to take effect."));
......
......@@ -60,7 +60,7 @@ export class LocalizationWorkbenchContribution extends Disposable implements IWo
updateAndRestart ? localize('updateLocale', "Would you like to change VS Code's UI language to {0} and restart?", e.local.manifest.contributes.localizations[0].languageName || e.local.manifest.contributes.localizations[0].languageId)
: localize('activateLanguagePack', "In order to use VS Code in {0}, VS Code needs to restart.", e.local.manifest.contributes.localizations[0].languageName || e.local.manifest.contributes.localizations[0].languageId),
[{
label: updateAndRestart ? localize('yes', "Yes") : localize('restart now', "Restart Now"),
label: updateAndRestart ? localize('changeAndRestart', "Change Language and Restart") : localize('restart', "Restart"),
run: () => {
const updatePromise = updateAndRestart ? this.jsonEditingService.write(this.environmentService.argvResource, [{ path: ['locale'], value: locale }], true) : Promise.resolve(undefined);
updatePromise.then(() => this.hostService.restart(), e => this.notificationService.error(e));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册