From f2860b493b55a0a68689289f9a0194aa2f40d1a6 Mon Sep 17 00:00:00 2001 From: Heyward Fann Date: Thu, 10 Dec 2020 16:55:04 +0800 Subject: [PATCH] feat: add insertSpaceAfterOpeningAndBeforeClosingEmptyBraces (#239) https://github.com/microsoft/TypeScript/pull/41304 --- Readme.md | 4 ++++ package.json | 8 ++++++++ src/server/features/fileConfigurationManager.ts | 1 + 3 files changed, 13 insertions(+) diff --git a/Readme.md b/Readme.md index e868e78..2cc53cd 100644 --- a/Readme.md +++ b/Readme.md @@ -158,6 +158,8 @@ for guide of coc.nvim's configuration. - `typescript.format.insertSpaceBeforeFunctionParenthesis` default: `false` - `typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets` default: `false` +- `typescript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces` + default: `false` - `typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces` default: `false` - `typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis` @@ -202,6 +204,8 @@ for guide of coc.nvim's configuration. - `javascript.format.insertSpaceBeforeFunctionParenthesis` default: `false` - `javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets` default: `false` +- `javascript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces` + default: `false` - `javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces` default: `false` - `javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis` diff --git a/package.json b/package.json index 7f12565..5d28bf9 100644 --- a/package.json +++ b/package.json @@ -379,6 +379,10 @@ "type": "boolean", "default": false }, + "typescript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": { + "type": "boolean", + "default": false + }, "typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": { "type": "boolean", "default": false @@ -557,6 +561,10 @@ "type": "boolean", "default": false }, + "javascript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": { + "type": "boolean", + "default": false + }, "javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": { "type": "boolean", "default": false diff --git a/src/server/features/fileConfigurationManager.ts b/src/server/features/fileConfigurationManager.ts index e3c0420..03e3c3c 100644 --- a/src/server/features/fileConfigurationManager.ts +++ b/src/server/features/fileConfigurationManager.ts @@ -136,6 +136,7 @@ export default class FileConfigurationManager { insertSpaceBeforeFunctionParenthesis: config.get('insertSpaceBeforeFunctionParenthesis'), insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: config.get('insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis'), insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: config.get('insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets'), + insertSpaceAfterOpeningAndBeforeClosingEmptyBraces: config.get('insertSpaceAfterOpeningAndBeforeClosingEmptyBraces'), insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: config.get('insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces'), insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: config.get('insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces'), insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: config.get('insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces'),