Skip to content

'infer function return type' refactoring always shown #42993

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

Closed
mjbvz opened this issue Feb 26, 2021 · 4 comments
Closed

'infer function return type' refactoring always shown #42993

mjbvz opened this issue Feb 26, 2021 · 4 comments

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Feb 26, 2021

Bug Report

🔎 Search Terms

  • refactoring
  • quick fix
  • code action

🕗 Version & Regression Information

4.2.2

💻 Code

function foo() {
    return 1;
}
  1. In VS Code, place cursor anywhere inside of foo

🙁 Actual behavior

The lightbulb always shows up. This is because the infer function return type quick fix is always being returned

🙂 Expected behavior

This quick fix should likely only show when refactoring are explicitly requested or if the cursor is at a specific spot in the code (such as the function signature)

/cc @jessetrinity

@mjbvz
Copy link
Contributor Author

mjbvz commented Feb 26, 2021

I have a feeling the ever present lightbulb is going to spawn a lot of issues when the next VS Code release goes out so I'm going to add a workaround on the VS Code side

@mjbvz mjbvz changed the title 'infer function return type' quick fix always shown 'infer function return type' refactoring always shown Feb 26, 2021
@jessetrinity
Copy link
Contributor

Is this fixed by #42737?

@mjbvz
Copy link
Contributor Author

mjbvz commented Feb 27, 2021

Yep looks like the same issue. I've checked in a workaround on the VS Code side

@jwbth
Copy link

jwbth commented Nov 7, 2024

Oh that's why I didn't see the item for "Infer function return type" in the autocomplete menu...
Image
Good thing I though of searching the source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants