From 28584be538680ece20f6af975ad88a3d0c0fa7e5 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Tue, 9 Apr 2019 21:17:23 +0000 Subject: [PATCH] Fix #71987 --- .../contrib/format/browser/formatActionsMultiple.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/format/browser/formatActionsMultiple.ts b/src/vs/workbench/contrib/format/browser/formatActionsMultiple.ts index 47c1a541576a5..9b3315f19dd60 100644 --- a/src/vs/workbench/contrib/format/browser/formatActionsMultiple.ts +++ b/src/vs/workbench/contrib/format/browser/formatActionsMultiple.ts @@ -36,7 +36,7 @@ class DefaultFormatter extends Disposable implements IWorkbenchContribution { static configName = 'editor.defaultFormatter'; - static extensionIds: string[] = []; + static extensionIds: (string | null)[] = []; static extensionDescriptions: string[] = []; constructor( @@ -60,6 +60,10 @@ class DefaultFormatter extends Disposable implements IWorkbenchContribution { DefaultFormatter.extensionIds.length = 0; DefaultFormatter.extensionDescriptions.length = 0; + + DefaultFormatter.extensionIds.push(null); + DefaultFormatter.extensionDescriptions.push(nls.localize('nullFormatterDescription', "None")); + for (const extension of extensions) { if (extension.main) { DefaultFormatter.extensionIds.push(extension.identifier.value); @@ -156,7 +160,7 @@ Registry.as(ConfigurationExtensions.Configuration).regis properties: { [DefaultFormatter.configName]: { description: nls.localize('formatter.default', "Defines a default formatter which takes precedence over all other formatter settings. Must be the identifier of an extension contributing a formatter."), - type: 'string', + type: ['string', 'null'], default: null, enum: DefaultFormatter.extensionIds, markdownEnumDescriptions: DefaultFormatter.extensionDescriptions