Skip to content
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

be able to disable the 'This may be converted to an async function' tooltip #61326

Closed
AlexGalays opened this issue Oct 19, 2018 · 7 comments
Closed
Assignees
Labels
javascript JavaScript support issues *question Issue represents a question, should be posted to StackOverflow (VS Code)

Comments

@AlexGalays
Copy link

Can we have an option to specifically disable this "hint"? Not everyone find the async function style superior. I'm never going to use this refactoring so it just hinders the readability of my files compared to previous versions of vscode.

image

@vscodebot vscodebot bot added the javascript JavaScript support issues label Oct 19, 2018
@mjbvz
Copy link
Contributor

mjbvz commented Oct 22, 2018

Set "javascript.suggestionActions.enabled": false or "typescript.suggestionActions.enabled": false to disable these

@mjbvz mjbvz closed this as completed Oct 22, 2018
@mjbvz mjbvz added the *question Issue represents a question, should be posted to StackOverflow (VS Code) label Oct 22, 2018
@arenddeboer
Copy link

I also favour promises and simply disabling all suggestions feels rather heavy handed.

@AlexGalays
Copy link
Author

yes, the granularity is too coarse here.

@joshburgess
Copy link

Many people don't find async/await to be superior in any way. This should be configurable on its own.

@trusktr
Copy link

trusktr commented Nov 4, 2018

Async is superior (IMO). :)

But still, for a function that manually returns a promise but never uses the await keyword anywhere in it's body, this tip is pointless. There's absolutely no reason to convert a non-await-using function into an async function. This tip should only appear (as an error) if we try to use await in a non-async function.

@alanxone
Copy link

alanxone commented Nov 20, 2018

Totally agree with @trusktr.

Disable the suggestionActions (JS/TS) is not the right way for us, since these two options control all diagnostics of JS/TS.

@AlexGalays
Copy link
Author

AlexGalays commented Nov 21, 2018

Async is superior (IMO). :)

But still, for a function that manually returns a promise but never uses the await keyword anywhere in it's body, this tip is pointless. There's absolutely no reason to convert a non-await-using function into an async function. This tip should only appear (as an error) if we try to use await in a non-async function.

Let's not make it a discussion about which style is superior; I just wanted to illustrate that not everyone like the async style more than the explicit Promise style with a personal example.

vscode should be completely unbiased regarding coding practices. So either remove that half baked hint completely, or provide an option to toggle it in/out.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
javascript JavaScript support issues *question Issue represents a question, should be posted to StackOverflow (VS Code)
Projects
None yet
Development

No branches or pull requests

6 participants