Skip to content

Commit de48036

Browse files
krkweswigham
authored andcommitted
Disable truncation for codefixes in signatureToMethodDeclaration. (microsoft#28188)
1 parent 5788446 commit de48036

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

src/services/codefixes/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ namespace ts.codefix {
9797
optional: boolean,
9898
body: Block | undefined,
9999
): MethodDeclaration | undefined {
100-
const signatureDeclaration = <MethodDeclaration>checker.signatureToSignatureDeclaration(signature, SyntaxKind.MethodDeclaration, enclosingDeclaration, NodeBuilderFlags.SuppressAnyReturnType);
100+
const signatureDeclaration = <MethodDeclaration>checker.signatureToSignatureDeclaration(signature, SyntaxKind.MethodDeclaration, enclosingDeclaration, NodeBuilderFlags.NoTruncation | NodeBuilderFlags.SuppressAnyReturnType);
101101
if (!signatureDeclaration) {
102102
return undefined;
103103
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/// <reference path='fourslash.ts' />
2+
3+
////namespace some.really.long.generated.type.goes.here.you.know.this_.should.be.pretty.simple {
4+
//// export interface Yah {}
5+
////}
6+
////namespace another.really.long.generated.type.goes.here.too.because.who.cares.about.space.do_.you.feel.me {
7+
//// export interface Yah {}
8+
////}
9+
////interface this_will_be_collapsed {}
10+
////interface this_is_fine {}
11+
////abstract class AbstractCstVisitor {
12+
//// abstract Node(
13+
//// arg1: [
14+
//// some.really.long.generated.type.goes.here.you.know.this_.should.be.pretty.simple.Yah[],
15+
//// another.really.long.generated.type.goes.here.too.because.who.cares.about.space.do_.you.feel.me.Yah[]
16+
//// ],
17+
//// arg2: [this_will_be_collapsed],
18+
//// arg3: Set<this_will_be_collapsed>,
19+
//// arg4: this_is_fine
20+
//// ): Set<this_will_be_collapsed>;
21+
////}
22+
////class CstVisitorImplementation extends AbstractCstVisitor {}
23+
24+
verify.codeFix({
25+
description: "Implement inherited abstract class",
26+
newFileContent: `namespace some.really.long.generated.type.goes.here.you.know.this_.should.be.pretty.simple {
27+
export interface Yah {}
28+
}
29+
namespace another.really.long.generated.type.goes.here.too.because.who.cares.about.space.do_.you.feel.me {
30+
export interface Yah {}
31+
}
32+
interface this_will_be_collapsed {}
33+
interface this_is_fine {}
34+
abstract class AbstractCstVisitor {
35+
abstract Node(
36+
arg1: [
37+
some.really.long.generated.type.goes.here.you.know.this_.should.be.pretty.simple.Yah[],
38+
another.really.long.generated.type.goes.here.too.because.who.cares.about.space.do_.you.feel.me.Yah[]
39+
],
40+
arg2: [this_will_be_collapsed],
41+
arg3: Set<this_will_be_collapsed>,
42+
arg4: this_is_fine
43+
): Set<this_will_be_collapsed>;
44+
}
45+
class CstVisitorImplementation extends AbstractCstVisitor {
46+
Node(arg1: [some.really.long.generated.type.goes.here.you.know.this_.should.be.pretty.simple.Yah[], another.really.long.generated.type.goes.here.too.because.who.cares.about.space.do_.you.feel.me.Yah[]], arg2: [this_will_be_collapsed], arg3: any, arg4: this_is_fine) {
47+
throw new Error("Method not implemented.");
48+
}
49+
}`
50+
});

0 commit comments

Comments
 (0)