From 73cfa64f448c742d8216b7b74ee60457acf30b89 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Mon, 17 Jul 2017 14:47:10 -0700 Subject: [PATCH] Make sure not to truncate the stringified type from typeToString --- src/services/codefixes/fixJSDocTypes.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/codefixes/fixJSDocTypes.ts b/src/services/codefixes/fixJSDocTypes.ts index d0adb9d98c3..249bc32dbf7 100644 --- a/src/services/codefixes/fixJSDocTypes.ts +++ b/src/services/codefixes/fixJSDocTypes.ts @@ -15,11 +15,11 @@ namespace ts.codefix { const jsdocType = (decl as VariableDeclaration).type; const original = getTextOfNode(jsdocType); const type = checker.getTypeFromTypeNode(jsdocType); - const actions = [createAction(jsdocType, sourceFile.fileName, original, checker.typeToString(type))]; + const actions = [createAction(jsdocType, sourceFile.fileName, original, checker.typeToString(type, /*enclosingDeclaration*/ undefined, TypeFormatFlags.NoTruncation))]; if (jsdocType.kind === SyntaxKind.JSDocNullableType) { // for nullable types, suggest the flow-compatible `T | null | undefined` // in addition to the jsdoc/closure-compatible `T | null` - const replacementWithUndefined = checker.typeToString(checker.getNullableType(type, TypeFlags.Undefined)); + const replacementWithUndefined = checker.typeToString(checker.getNullableType(type, TypeFlags.Undefined), /*enclosingDeclaration*/ undefined, TypeFormatFlags.NoTruncation); actions.push(createAction(jsdocType, sourceFile.fileName, original, replacementWithUndefined)); } return actions;