TypeScript/tests/cases/fourslash/codeFixCorrectReturnValue26.ts
Wenlu Wang afc41f095d
Quick fix for functions lacking return expressions (#26434)
* stash

* add surmise for return type

* add support for more case

* add more test case

* add more testcase and fix all test

* fix changed diagnosis

* fix broken test case

* add more case

* rename quickfix

* fix conflict

* fix fix desc

* fix semi

* Avoid replace brace with paren

* Split fix all action

* Add return work in same line

* fix test cases

* rename baseline

* refactor and handle comment

* Support semi

* make helper internal
2020-04-02 10:06:14 -07:00

24 lines
398 B
TypeScript

/// <reference path='fourslash.ts' />
//// interface A {
//// bar: string;
//// }
////
//// function Foo (a: () => A) { a(); }
//// Foo(() => {
//// { bar: '123'; }
//// })
verify.codeFix({
description: "Add a return statement",
index: 0,
newFileContent:
`interface A {
bar: string;
}
function Foo (a: () => A) { a(); }
Foo(() => {
return { bar: '123' };
})`
})