-
Notifications
You must be signed in to change notification settings - Fork 37.4k
New config to turn off TypeScript autocomplete suggestions #58011
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
Conversation
| element: Proto.CompletionEntry, | ||
| completionConfiguration: CompletionConfiguration | ||
| ) { | ||
| const isNameSuggestion = element.kind === PConst.Kind.warning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a semicolon 😬
(agree with the refactoring here btw, much more readable 👍)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, right. Reflexes 😄
|
The idea behind this PR seems fine. However I believe this new setting should disable all completions from js/ts, including name based suggestions. This is what similar settings like Also keep in mind that we make no guarantees that our built-in js/ts support will work at all for flow code (and operations like formatting or refactoring may even break flow code). That's why we recommend disabling the built-in js/ts support if you are using the flow extension. The flow extension really needs to implement these tooling feature on their side to ensure they work properly |
|
Great. You are right about the approach of having extensions take over full responsibility for things being better. But that might take a while and this config change is pretty simple (and would also be simple to remove later) and solves the problem today. I will remove the distinction between name suggestions / others, and just have it disable every suggestion. You make a good point that it would break from the convention a bit. |
|
You can now manage built-in extensions: https://code.visualstudio.com/updates/v1_21#_extensions which will disable TS/JS autocomplete and you can easily use flow in VS Code, so why this is needed? Or I'm missing something? |
|
If you disable the builtin "TypeScript and JavaScript Language Features" extension, you'll loose a whole lot of other things than autocomplete suggestions, too. JSDoc completion, symbol renaming etc. |
|
@noppa Thanks, good to know. Also, I totally agree with @mjbvz it is Flow extension responsibility, but as I know they actually don't care and to be honest TypeScript is way better since it works way faster, you get refactoring for file names, paths, etc. If you really want good support for Flow and to use VS Code you should create your own extension. Maybe it makes sense to control built-in JS/TS language features instead of disabling them all, like checkboxes with variuos features like renaming, jsdoc completion, linting, autocompletion, etc. I believe it would be good feature request. |
|
@svipben
That question is answered in the PR description in the section under So, what am I doing submitting a PR for a setting? Why doesn't #17068 solve the problem?
I like the
This is a simple change that solves a specific problem. That might be a good feature for that other people need for broader usecases but this PR is just focused on disabling JS/TS autocomplete suggestions for a nicer experience working with flow and |
|
Just a heads up: I'm renaming this setting to |
A new
typescript.suggestions.enabledconfig (boolean, defaulttrue)Setting
falseremoves all autocomplete suggestions provided by typescript via the built-in typescript-language-features extension.The default is
true, so that existing behaviour remains the same.Why?
The typescript autocomplete suggestions are a great feature, when you're working on a typescript project.
But when you're working on a flow project using the flow-for-vscode plugin, it provides its own autocomplete suggestions via flow. So your autocomplete gets littered with duplicate suggestions coming from both typescript and flow:
What this config does is turns off the typescript suggestions, so you get this instead:
I.e. no duplicates, only the
flow-for-vscodesuggestions. Problem solved.Prior Issues
There have been a few existing issues raised about this problem both on the
flow-for-vscodeproject and here.Quoting from the third issue there
So, what am I doing submitting a PR for a setting? Why doesn't #17068 solve the problem?
Well, the thing is, as I commented here, I don't want to disable all of the javascript & typescript extension. I only want to disable the autocomplete suggestions coming from typescript.
Why? Because the extension also provides some other functionality I can't do without.
It's actually worse to lose this functionality, than to just deal with the duplicates in autocomplete. So this is definitely not a solution to the problem.
I really believe vscode needs the ability to turn off typescript autocomplete, specifically. Flow support provided via the awesome flow-for-vscode combined with all of the rest vscode's great feature set makes it a really good editor for flow projects, but this autocomplete issue is one of the last remaining obvious and annoying things that just get in the way of productivity. And it's so easy to fix!