-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(16755): show QF to declare missing properties in a call expressi…
…on with an object literal argument
- Loading branch information
1 parent
a7a0d25
commit 63991bb
Showing
5 changed files
with
113 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
////interface Foo { | ||
//// a: number; | ||
//// b: number; | ||
////} | ||
////function f(foo: Foo) {} | ||
////[|f({})|]; | ||
|
||
verify.codeFix({ | ||
index: 0, | ||
description: ts.Diagnostics.Add_missing_properties.message, | ||
newRangeContent: | ||
`f({ | ||
a: 0, | ||
b: 0 | ||
})` | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
////interface Foo { | ||
//// a: number; | ||
//// b: number; | ||
//// c: () => void; | ||
////} | ||
////function f(foo: Foo) {} | ||
////[|f({ a: 10 })|]; | ||
|
||
verify.codeFix({ | ||
index: 0, | ||
description: ts.Diagnostics.Add_missing_properties.message, | ||
newRangeContent: | ||
`f({ | ||
a: 10, | ||
b: 0, | ||
c: function(): void { | ||
throw new Error("Function not implemented."); | ||
} | ||
})` | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
////interface Foo { | ||
//// a: number; | ||
//// b: number; | ||
////} | ||
////function f(a: number, b: number, c: Foo) {} | ||
////[|f(1, 2, {})|]; | ||
|
||
verify.codeFix({ | ||
index: 0, | ||
description: ts.Diagnostics.Add_missing_properties.message, | ||
newRangeContent: | ||
`f(1, 2, { | ||
a: 0, | ||
b: 0 | ||
})` | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters