From c0a87e9947e48399d38ea5b0184299a0526ad99d Mon Sep 17 00:00:00 2001 From: SaschaNaz Date: Wed, 26 Aug 2015 02:01:33 +0900 Subject: [PATCH] fixing function type formatting --- src/services/formatting/smartIndenter.ts | 1 + tests/cases/fourslash/formattingFunctionType.ts | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 tests/cases/fourslash/formattingFunctionType.ts diff --git a/src/services/formatting/smartIndenter.ts b/src/services/formatting/smartIndenter.ts index c7f762fea64..30da55b8f37 100644 --- a/src/services/formatting/smartIndenter.ts +++ b/src/services/formatting/smartIndenter.ts @@ -429,6 +429,7 @@ namespace ts.formatting { case SyntaxKind.ArrayBindingPattern: case SyntaxKind.ObjectBindingPattern: case SyntaxKind.JsxElement: + case SyntaxKind.FunctionType: return true; } return false; diff --git a/tests/cases/fourslash/formattingFunctionType.ts b/tests/cases/fourslash/formattingFunctionType.ts new file mode 100644 index 00000000000..0e63292b5ed --- /dev/null +++ b/tests/cases/fourslash/formattingFunctionType.ts @@ -0,0 +1,17 @@ +/// + +////function renderElement( +//// element: Element, +//// renderNode: ( +//// node: Node/*paramInFuntionType*/ +/////*paramIndent*/ +//// ) => void +////): void { +////} + +format.document(); + +goTo.marker("paramInFuntionType"); +verify.currentLineContentIs(" node: Node"); +goTo.marker("paramIndent"); +verify.indentationIs(8); \ No newline at end of file