@@ -9,6 +9,7 @@ import { getConfigFileName, parseJSON } from "../utils";
9
9
// https://code.visualstudio.com/Docs/customization/userandworkspace
10
10
interface VSCodeSettings {
11
11
"typescript.format.insertSpaceAfterCommaDelimiter" : boolean ;
12
+ "typescript.format.insertSpaceAfterConstructor" : boolean ;
12
13
"typescript.format.insertSpaceAfterSemicolonInForStatements" : boolean ;
13
14
"typescript.format.insertSpaceBeforeAndAfterBinaryOperators" : boolean ;
14
15
"typescript.format.insertSpaceAfterKeywordsInControlFlowStatements" : boolean ;
@@ -18,13 +19,13 @@ interface VSCodeSettings {
18
19
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces" : boolean ;
19
20
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces" : boolean ;
20
21
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces" : boolean ;
22
+ "typescript.format.insertSpaceAfterTypeAssertion" : boolean ;
21
23
"typescript.format.insertSpaceBeforeFunctionParenthesis" : boolean ;
22
24
"typescript.format.placeOpenBraceOnNewLineForFunctions" : boolean ;
23
25
"typescript.format.placeOpenBraceOnNewLineForControlBlocks" : boolean ;
24
26
25
27
// NOTE https://github.com/Microsoft/vscode/issues/10296
26
- // baseIndentSize, insertSpaceAfterConstructor, insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces
27
- // insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces, insertSpaceAfterTypeAssertion, insertSpaceBeforeFunctionParenthesis
28
+ // baseIndentSize
28
29
}
29
30
30
31
export function makeFormatCodeOptions ( fileName : string , opts : Options , formatSettings : ts . FormatCodeSettings ) : ts . FormatCodeSettings {
@@ -47,6 +48,9 @@ export function makeFormatCodeOptions(fileName: string, opts: Options, formatSet
47
48
if ( config [ "typescript.format.insertSpaceAfterCommaDelimiter" ] != null ) {
48
49
formatSettings . insertSpaceAfterCommaDelimiter = config [ "typescript.format.insertSpaceAfterCommaDelimiter" ] ;
49
50
}
51
+ if ( config [ "typescript.format.insertSpaceAfterConstructor" ] != null ) {
52
+ formatSettings . insertSpaceAfterConstructor = config [ "typescript.format.insertSpaceAfterConstructor" ] ;
53
+ }
50
54
if ( config [ "typescript.format.insertSpaceAfterSemicolonInForStatements" ] != null ) {
51
55
formatSettings . insertSpaceAfterSemicolonInForStatements = config [ "typescript.format.insertSpaceAfterSemicolonInForStatements" ] ;
52
56
}
@@ -74,6 +78,9 @@ export function makeFormatCodeOptions(fileName: string, opts: Options, formatSet
74
78
if ( config [ "typescript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces" ] != null ) {
75
79
formatSettings . insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces = config [ "typescript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces" ] ;
76
80
}
81
+ if ( config [ "typescript.format.insertSpaceAfterTypeAssertion" ] != null ) {
82
+ formatSettings . insertSpaceAfterTypeAssertion = config [ "typescript.format.insertSpaceAfterTypeAssertion" ] ;
83
+ }
77
84
if ( config [ "typescript.format.insertSpaceBeforeFunctionParenthesis" ] != null ) {
78
85
formatSettings . insertSpaceBeforeFunctionParenthesis = config [ "typescript.format.insertSpaceBeforeFunctionParenthesis" ] ;
79
86
}
@@ -83,7 +90,6 @@ export function makeFormatCodeOptions(fileName: string, opts: Options, formatSet
83
90
if ( config [ "typescript.format.placeOpenBraceOnNewLineForControlBlocks" ] != null ) {
84
91
formatSettings . placeOpenBraceOnNewLineForControlBlocks = config [ "typescript.format.placeOpenBraceOnNewLineForControlBlocks" ] ;
85
92
}
86
- // TODO insertSpaceAfterTypeAssertion
87
93
88
94
return formatSettings ;
89
95
}
0 commit comments