merge conflict
This commit is contained in:
parent
273a0dbdfe
commit
ebf46a77e9
2 changed files with 29 additions and 29 deletions
|
@ -3524,11 +3524,11 @@ namespace FourSlashInterface {
|
|||
this.state.formatOnType(this.state.getMarkerByName(posMarker).position, key);
|
||||
}
|
||||
|
||||
public setOption(name: string, value: number): void;
|
||||
public setOption(name: string, value: string): void;
|
||||
public setOption(name: string, value: boolean): void;
|
||||
public setOption(name: string, value: any): void {
|
||||
(<any>this.state.formatCodeSettings)[name] = value;
|
||||
public setOption(name: keyof ts.FormatCodeSettings, value: number): void;
|
||||
public setOption(name: keyof ts.FormatCodeSettings, value: string): void;
|
||||
public setOption(name: keyof ts.FormatCodeSettings, value: boolean): void;
|
||||
public setOption(name: keyof ts.FormatCodeSettings, value: any): void {
|
||||
this.state.formatCodeSettings[name] = value;
|
||||
}
|
||||
|
||||
public getOption(name: keyof ts.FormatCodeSettings) {
|
||||
|
|
|
@ -1,32 +1,32 @@
|
|||
///<reference path="fourslash.ts"/>
|
||||
|
||||
/////*InsertSpaceAfterCommaDelimiter*/[1,2, 3];[ 72 , ];
|
||||
/////*InsertSpaceAfterSemicolonInForStatements*/for (i = 0;i; i++);
|
||||
/////*InsertSpaceBeforeAndAfterBinaryOperators*/1+2- 3
|
||||
/////*InsertSpaceAfterKeywordsInControlFlowStatements*/if (true) { }
|
||||
/////*InsertSpaceAfterFunctionKeywordForAnonymousFunctions*/(function () { })
|
||||
/////*InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis*/(1 )
|
||||
/////*InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets*/[1 ]; [ ]; []; [,];
|
||||
/////*InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces*/`${1}`;`${ 1 }`
|
||||
/////*InsertSpaceAfterTypeAssertion*/const bar = <Bar> Thing.getFoo();
|
||||
/////*PlaceOpenBraceOnNewLineForFunctions*/class foo {
|
||||
/////*insertSpaceAfterCommaDelimiter*/[1,2, 3];[ 72 , ];
|
||||
/////*insertSpaceAfterSemicolonInForStatements*/for (i = 0;i; i++);
|
||||
/////*insertSpaceBeforeAndAfterBinaryOperators*/1+2- 3
|
||||
/////*insertSpaceAfterKeywordsInControlFlowStatements*/if (true) { }
|
||||
/////*insertSpaceAfterFunctionKeywordForAnonymousFunctions*/(function () { })
|
||||
/////*insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis*/(1 )
|
||||
/////*insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets*/[1 ]; [ ]; []; [,];
|
||||
/////*insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces*/`${1}`;`${ 1 }`
|
||||
/////*insertSpaceAfterTypeAssertion*/const bar = <Bar> Thing.getFoo();
|
||||
/////*placeOpenBraceOnNewLineForFunctions*/class foo {
|
||||
////}
|
||||
/////*PlaceOpenBraceOnNewLineForControlBlocks*/if (true) {
|
||||
/////*placeOpenBraceOnNewLineForControlBlocks*/if (true) {
|
||||
////}
|
||||
/////*InsertSpaceAfterOpeningAndBeforeClosingNonemptyBraces*/{ var t = 1}; var {a,b } = { a: 'sw', b:'r' };function f( { a, b}) { }
|
||||
/////*insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces*/{ var t = 1}; var {a,b } = { a: 'sw', b:'r' };function f( { a, b}) { }
|
||||
|
||||
runTest("InsertSpaceAfterCommaDelimiter", "[1, 2, 3];[72,];", "[1,2,3];[72,];");
|
||||
runTest("InsertSpaceAfterSemicolonInForStatements", "for (i = 0; i; i++);", "for (i = 0;i;i++);");
|
||||
runTest("InsertSpaceBeforeAndAfterBinaryOperators", "1 + 2 - 3", "1+2-3");
|
||||
runTest("InsertSpaceAfterKeywordsInControlFlowStatements", "if (true) { }", "if(true) { }");
|
||||
runTest("InsertSpaceAfterFunctionKeywordForAnonymousFunctions", "(function () { })", "(function() { })");
|
||||
runTest("InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis", " ( 1 )", " (1)");
|
||||
runTest("InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets", "[ 1 ];[];[];[ , ];", "[1];[];[];[,];");
|
||||
runTest("InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces", "`${ 1 }`; `${ 1 }`", "`${1}`; `${1}`");
|
||||
runTest("InsertSpaceAfterTypeAssertion", "const bar = <Bar> Thing.getFoo();", "const bar = <Bar>Thing.getFoo();");
|
||||
runTest("PlaceOpenBraceOnNewLineForFunctions", "class foo", "class foo {");
|
||||
runTest("PlaceOpenBraceOnNewLineForControlBlocks", "if ( true )", "if ( true ) {");
|
||||
runTest("InsertSpaceAfterOpeningAndBeforeClosingNonemptyBraces", "{ var t = 1 }; var { a, b } = { a: 'sw', b: 'r' }; function f({ a, b }) { }", "{var t = 1}; var {a, b} = {a: 'sw', b: 'r'}; function f({a, b}) {}");
|
||||
runTest("insertSpaceAfterCommaDelimiter", "[1, 2, 3];[72,];", "[1,2,3];[72,];");
|
||||
runTest("insertSpaceAfterSemicolonInForStatements", "for (i = 0; i; i++);", "for (i = 0;i;i++);");
|
||||
runTest("insertSpaceBeforeAndAfterBinaryOperators", "1 + 2 - 3", "1+2-3");
|
||||
runTest("insertSpaceAfterKeywordsInControlFlowStatements", "if (true) { }", "if(true) { }");
|
||||
runTest("insertSpaceAfterFunctionKeywordForAnonymousFunctions", "(function () { })", "(function() { })");
|
||||
runTest("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis", " ( 1 )", " (1)");
|
||||
runTest("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets", "[ 1 ];[];[];[ , ];", "[1];[];[];[,];");
|
||||
runTest("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces", "`${ 1 }`; `${ 1 }`", "`${1}`; `${1}`");
|
||||
runTest("insertSpaceAfterTypeAssertion", "const bar = <Bar> Thing.getFoo();", "const bar = <Bar>Thing.getFoo();");
|
||||
runTest("placeOpenBraceOnNewLineForFunctions", "class foo", "class foo {");
|
||||
runTest("placeOpenBraceOnNewLineForControlBlocks", "if ( true )", "if ( true ) {");
|
||||
runTest("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces", "{ var t = 1 }; var { a, b } = { a: 'sw', b: 'r' }; function f({ a, b }) { }", "{var t = 1}; var {a, b} = {a: 'sw', b: 'r'}; function f({a, b}) {}");
|
||||
|
||||
const defaultFormatOption = format.copyFormatOptions();
|
||||
function runTest(propertyName: string, expectedStringWhenTrue: string, expectedStringWhenFalse: string) {
|
||||
|
|
Loading…
Reference in a new issue