forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
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 (microsoft#44781)
- Loading branch information
1 parent
1b587e8
commit 0ed3834
Showing
5 changed files
with
117 additions
and
34 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