Skip to content

Quick fix for functions lacking return expressions #26434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 28 commits into from
Apr 2, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
3f59aa9
stash
Kingwl Aug 10, 2018
7671221
add surmise for return type
Kingwl Aug 14, 2018
0b1e6cc
add support for more case
Kingwl Aug 14, 2018
1f9b9c0
add more test case
Kingwl Aug 16, 2018
aca1722
add more testcase and fix all test
Kingwl Aug 20, 2018
7cfd0fb
Merge branch 'master' into returnValueSurmise
Kingwl Apr 29, 2019
cbe59bb
fix changed diagnosis
Kingwl Apr 30, 2019
48f1cca
Merge branch 'master' into returnValueSurmise
Kingwl May 8, 2019
98d7eba
fix broken test case
Kingwl May 8, 2019
537e806
add more case
Kingwl May 8, 2019
505e299
Merge branch 'master' into returnValueSurmise
Kingwl Jan 9, 2020
6fecf32
rename quickfix
Kingwl Jan 9, 2020
4c0af72
fix conflict
Kingwl Jan 9, 2020
98377f3
fix fix desc
Kingwl Jan 9, 2020
49d21bf
fix semi
Kingwl Jan 9, 2020
a2b15ed
Merge branch 'master' into returnValueSurmise
Kingwl Mar 4, 2020
eabc5a4
Merge branch 'master' into returnValueSurmise
Kingwl Mar 4, 2020
944ddf4
Avoid replace brace with paren
Kingwl Mar 18, 2020
6c88a01
Split fix all action
Kingwl Mar 18, 2020
94f845a
Add return work in same line
Kingwl Mar 18, 2020
a7f37a3
Merge branch 'master' into returnValueSurmise
Kingwl Mar 18, 2020
7fe9a82
fix test cases
Kingwl Mar 18, 2020
af9552e
rename baseline
Kingwl Mar 26, 2020
601fc5e
refactor and handle comment
Kingwl Mar 26, 2020
175cf4e
Support semi
Kingwl Mar 26, 2020
8b332fe
Merge branch 'master' into returnValueSurmise
Kingwl Mar 26, 2020
5d8355c
make helper internal
Kingwl Mar 26, 2020
522cac8
Merge branch 'master' into returnValueSurmise
Kingwl Apr 2, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add more case
  • Loading branch information
Kingwl committed May 8, 2019
commit 537e806b03fbe7d4337c8221dcae3a5e10e2391c
8 changes: 7 additions & 1 deletion tests/cases/fourslash/codeFixSurmiseReturnValue_all1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
//// const baz5: ((() => number) | (() => A)) = () => {
//// bar: '1'
//// }
////
//// const test: { a: () => A } = { a: () => { bar: '1' } }

verify.codeFixAll({
fixId: "fixAddReturnStatement",
Expand Down Expand Up @@ -111,5 +113,9 @@ const baz4: ((() => number) | (() => A)) = () => {
}
const baz5: ((() => number) | (() => A)) = () => {
return { bar: '1' };
}`,
}

const test: { a: () => A } = { a: () => {
return { bar: '1' };
} }`,
});
6 changes: 5 additions & 1 deletion tests/cases/fourslash/codeFixSurmiseReturnValue_all2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
//// const baz5: ((() => number) | (() => A)) = () => {
//// bar: '1'
//// }
////
//// const test: { a: () => A } = { a: () => { bar: '1' } }

verify.codeFixAll({
fixId: "fixRemoveBlockBodyBrace",
Expand Down Expand Up @@ -91,5 +93,7 @@ const baz1: () => number = () => 1
const baz2: () => A = () => ({ bar: '1' })
const baz3: () => A = () => ({ bar: '1' })
const baz4: ((() => number) | (() => A)) = () => 1
const baz5: ((() => number) | (() => A)) = () => ({ bar: '1' })`,
const baz5: ((() => number) | (() => A)) = () => ({ bar: '1' })

const test: { a: () => A } = { a: () => ({ bar: '1' }) }`,
});
6 changes: 5 additions & 1 deletion tests/cases/fourslash/codeFixSurmiseReturnValue_all3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
//// const baz5: ((() => number) | (() => A)) = () => {
//// bar: '1'
//// }
////
//// const test: { a: () => A } = { a: () => { bar: '1' } }

verify.codeFixAll({
fixId: "fixReplaceBraceWithParen",
Expand Down Expand Up @@ -91,5 +93,7 @@ const baz1: () => number = () => (1)
const baz2: () => A = () => ({ bar: '1' })
const baz3: () => A = () => ({ bar: '1' })
const baz4: ((() => number) | (() => A)) = () => (1)
const baz5: ((() => number) | (() => A)) = () => ({ bar: '1' })`,
const baz5: ((() => number) | (() => A)) = () => ({ bar: '1' })

const test: { a: () => A } = { a: () => ({ bar: '1' }) }`,
});
6 changes: 5 additions & 1 deletion tests/cases/fourslash/codeFixSurmiseReturnValue_all4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
//// const baz5: ((() => number) | (() => A)) = () => {
//// bar: '1'
//// }
////
//// const test: { a: () => A } = { a: () => { bar: '1' } }

verify.codeFixAll({
fixId: "fixWrapTheBlockWithParen",
Expand Down Expand Up @@ -91,5 +93,7 @@ const baz1: () => number = () => (1)
const baz2: () => A = () => ({ bar: '1' })
const baz3: () => A = () => ({ bar: '1' })
const baz4: ((() => number) | (() => A)) = () => (1)
const baz5: ((() => number) | (() => A)) = () => ({ bar: '1' })`,
const baz5: ((() => number) | (() => A)) = () => ({ bar: '1' })

const test: { a: () => A } = { a: () => ({ bar: '1' }) }`,
});
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy