Skip to content

Commit

Permalink
Merge pull request #72024 from Microsoft/roblou/fixFormatterSettingDe…
Browse files Browse the repository at this point in the history
…fault

Fix #71987
  • Loading branch information
jrieken authored Apr 10, 2019
2 parents 2f7c397 + 28584be commit d1875a0
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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);
Expand Down Expand Up @@ -156,7 +160,7 @@ Registry.as<IConfigurationRegistry>(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
Expand Down

0 comments on commit d1875a0

Please sign in to comment.