-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Extra entries for JavaScript auto complete(intellisense) make no sense #15679
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
Comments
Note: This document: #4793 mentions: Which might have been the origin of this. But I see no point in all the entries added above, specially for the typed case. |
There's honestly no guarantees we can make in JS mode. You could have captured the value in a closure and done something to it, and I'm not certain it makes sense to do extra checks to ensure of the scenario. Additionally, while you don't find it useful, other people might. Specifically, identifiers used elsewhere in the file might be used to define a property on the current object. It seems unnecessarily restrictive to remove those. Personally, I appreciate the flexibility when I'm not getting any type-checking. If you're seeing this behavior in |
There is one guarantee that is made by adding those entries: It is guaranteed to diminish the usefulness of the intellisense feature for javascript. I would like to hear from someone the use anyone can make for the specific entries I mentioned. Types? One argument inside another? The identifier itself inside the identifier? All global symbols? What is --checkJs ? |
Please see https://github.com/Microsoft/TypeScript/wiki/What%27s-new-in-TypeScript#errors-in-js-files-with---checkjs for more info |
Based on the discussion in #15747, there seems to be value in pruning the completion list for values we know have an explicit type. There is no planned changes for values that have type |
TypeScript Version: 2.2.1 / nightly (2.2.0-dev.201xxxxx)
Code
The following code in javascript:
// A *self-contained* demonstration of the problem follows...
Expected behavior:
When a javascript type is not "any", i.e. when it is definded in jsdoc or in the typescript definition helper (See https://github.com/Microsoft/TypeScript/wiki/JavaScript-Language-Service-in-Visual-Studio#unsupported-patterns) only those defined members should be part of intellisense.
Even if the type is any, throwing everything on intellisense like that defeats the purpose of finding out what reasonably could be under the object.
Actual behavior:
A bunch of extra entries show up in intellisnese that make no sense for either typed or untyped scenarios, but it is specially bad for typed scenarios where some thought was put in place in what should appear in intellisense. Adding all those entries makes the intellisense feature less useful.
The text was updated successfully, but these errors were encountered: