Heuristic/loose completions for the 'any' type
See original GitHub issueMotivation
Today, if you have a value of type ‘any’, dotting off of the value and requesting members for completion will return nothing back. The original motivation for this was that we should never risk giving users incorrect completions.
This is great for a fully typed TypeScript project. However, for those migrating to TypeScript, as well as those who need to drop down to any
fairly frequently, this can be slightly frustrating.
For those used to the JS editing experience in editors like Sublime where they just “got completions”, the current behavior might be seen as unattractive.
Proposal
We should consider adding a language service option for users to get “loose” completions akin to what we give in the Salsa language service.
We can still keep the warning for each completion, but we should provide completions with a builder.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:8 (7 by maintainers)
Top GitHub Comments
https://github.com/microsoft/TypeScript/issues/5334#issuecomment-516265598 suspect this isn’t TypeScript powered but vscode text-word-reuse (not actual name) powered
Yup, VS Code will give word completions in a
.ts
file, but only if you explicitly trigger it. You can see the difference if you use a comment.That said…VS Code’s word completions are pretty good. I requested this back when Visual Studio was our primary editor. Maybe we should roll with the current behavior?