Skip to content

Commit 11fbbe9

Browse files
committed
Added fourslash test
1 parent d12d46d commit 11fbbe9

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/// <reference path='fourslash.ts'/>
2+
3+
// @isolatedDeclarations: true
4+
// @declaration: true
5+
6+
//// export function f() {
7+
//// const o = /** before */ { /* inline post-{ */ // end line post-{
8+
//// // document first type
9+
//// /* inline before */ x /* inline pre-colon */ : /* inline pre-type */ 5 /* inline post-type */ , // after comma1
10+
//// // document second type
11+
//// /** 2 before */ y : 'str' /** 2 after */, //after comma2
12+
//// // pre-closing
13+
//// } /** after */;
14+
//// return o;
15+
//// }
16+
17+
verify.codeFix({
18+
description: `Add return type '{ /* inline post-{ */ // end line post-{
19+
x: number; // after comma1
20+
y: string; }'`,
21+
index: 0,
22+
newFileContent:
23+
`export function f(): {
24+
x: number;
25+
y: string;
26+
} {
27+
const o = /** before */ { /* inline post-{ */ // end line post-{
28+
// document first type
29+
/* inline before */ x /* inline pre-colon */ : /* inline pre-type */ 5 /* inline post-type */ , // after comma1
30+
// document second type
31+
/** 2 before */ y : 'str' /** 2 after */, //after comma2
32+
// pre-closing
33+
} /** after */;
34+
return o;
35+
}`,
36+
});
37+
38+

0 commit comments

Comments
 (0)