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

Heuristic/loose completions for the 'any' type #5334

Open
DanielRosenwasser opened this issue Oct 20, 2015 · 8 comments
Open

Heuristic/loose completions for the 'any' type #5334

DanielRosenwasser opened this issue Oct 20, 2015 · 8 comments
Labels
In Discussion Not yet reached consensus Suggestion An idea for TypeScript

Comments

@DanielRosenwasser
Copy link
Member

Motivation

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.

@DanielRosenwasser DanielRosenwasser added the Suggestion An idea for TypeScript label Oct 20, 2015
@Zorgatone
Copy link

Yeah, it should be useful. Like other normal JavaScript IDE are doing (ie. WebStorm and similars...)

@mhegazy
Copy link
Contributor

mhegazy commented Dec 9, 2015

We have something similar in JS file completions, i wounder if that is what we should enable if we run in an any.

@mhegazy mhegazy added the Needs Proposal This issue needs a plan that clarifies the finer details of how it could be implemented. label Dec 9, 2015
@DanielRosenwasser
Copy link
Member Author

That's precisely what I mean. 😃

@mhegazy mhegazy added In Discussion Not yet reached consensus and removed Needs Proposal This issue needs a plan that clarifies the finer details of how it could be implemented. labels Dec 10, 2015
@RyanCavanaugh
Copy link
Member

This happens now

@DanielRosenwasser
Copy link
Member Author

Not in a TypeScript file it doesn't.

@RyanCavanaugh
Copy link
Member

image

@basarat
Copy link
Contributor

basarat commented Jul 30, 2019

#5334 (comment) suspect this isn't TypeScript powered but vscode text-word-reuse (not actual name) powered

@DanielRosenwasser
Copy link
Member Author

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.

image

image

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
In Discussion Not yet reached consensus Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

5 participants