From aa9a8aa0e31fd2c23b46879c7c9d4e5864bac246 Mon Sep 17 00:00:00 2001 From: Qiming Zhao Date: Wed, 11 Dec 2019 18:50:15 +0800 Subject: [PATCH] support semicolons format option --- package.json | 24 ++++++++++++++++++- .../features/fileConfigurationManager.ts | 3 ++- yarn.lock | 8 +++---- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 0d5c26f..8113c20 100644 --- a/package.json +++ b/package.json @@ -333,6 +333,17 @@ "type": "boolean", "default": false }, + "typescript.format.semicolons": { + "type": "string", + "default": "ignore", + "description": "Defines handling of optional semicolons. Requires using TypeScript 3.7 or newer in the workspace.", + "scope": "resource", + "enum": [ + "ignore", + "insert", + "remove" + ] + }, "javascript.showUnused": { "type": "boolean", "default": true, @@ -464,6 +475,17 @@ "javascript.format.placeOpenBraceOnNewLineForControlBlocks": { "type": "boolean", "default": false + }, + "javascript.format.semicolons": { + "type": "string", + "default": "ignore", + "description": "Defines handling of optional semicolons. Requires using TypeScript 3.7 or newer in the workspace.", + "scope": "resource", + "enum": [ + "ignore", + "insert", + "remove" + ] } } }, @@ -497,6 +519,6 @@ "which": "^2.0.1" }, "dependencies": { - "typescript": "3.7.2" + "typescript": "3.7.3" } } diff --git a/src/server/features/fileConfigurationManager.ts b/src/server/features/fileConfigurationManager.ts index 109a924..36fcb44 100644 --- a/src/server/features/fileConfigurationManager.ts +++ b/src/server/features/fileConfigurationManager.ts @@ -124,7 +124,8 @@ export default class FileConfigurationManager { insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: config.get('insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces'), insertSpaceAfterTypeAssertion: config.get('insertSpaceAfterTypeAssertion'), placeOpenBraceOnNewLineForFunctions: config.get('placeOpenBraceOnNewLineForFunctions'), - placeOpenBraceOnNewLineForControlBlocks: config.get('placeOpenBraceOnNewLineForControlBlocks') + placeOpenBraceOnNewLineForControlBlocks: config.get('placeOpenBraceOnNewLineForControlBlocks'), + semicolons: config.get('semicolons', undefined) } } diff --git a/yarn.lock b/yarn.lock index 7c9164a..3d62bc4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3120,10 +3120,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@3.7.2: - version "3.7.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.2.tgz#27e489b95fa5909445e9fef5ee48d81697ad18fb" - integrity sha512-ml7V7JfiN2Xwvcer+XAf2csGO1bPBdRbFCkYBczNZggrBZ9c7G3riSUeJmqEU5uOtXNPMhE3n+R4FA/3YOAWOQ== +typescript@3.7.3: + version "3.7.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.3.tgz#b36840668a16458a7025b9eabfad11b66ab85c69" + integrity sha512-Mcr/Qk7hXqFBXMN7p7Lusj1ktCBydylfQM/FZCk5glCNQJrCUKPkMHdo9R0MTFWsC/4kPFvDS0fDPvukfCkFsw== union-value@^1.0.0: version "1.0.1"