TypeScript/tests/cases/fourslash/formattingSpaceBeforeFunctionParen.ts
Vakhurin Sergey 2b6ef79ada Fixed incorrect insertSpaceBeforeFunctionParenthesis behavior on functions with type-arguments
There was an interference between the SpaceBeforeOpenParenInFuncDecl and the NoSpaceAfterCloseAngularBracket rules. So, the NoSpaceAfterCloseAngularBracket eliminated a space which has been added by the SpaceBeforeOpenParenInFuncDecl rule.
2017-10-19 02:00:05 +03:00

22 lines
683 B
TypeScript

/// <reference path='fourslash.ts' />
/////*1*/function foo() { }
/////*2*/function boo () { }
/////*3*/var bar = function foo() { };
/////*4*/var foo = { bar() { } };
/////*5*/function tmpl <T> () { }
format.setOption("InsertSpaceBeforeFunctionParenthesis", true);
format.document();
goTo.marker('1');
verify.currentLineContentIs('function foo () { }');
goTo.marker('2');
verify.currentLineContentIs('function boo () { }');
goTo.marker('3');
verify.currentLineContentIs('var bar = function foo () { };');
goTo.marker('4');
verify.currentLineContentIs('var foo = { bar () { } };');
goTo.marker('5');
verify.currentLineContentIs('function tmpl<T> () { }');