-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Intellisense does not work for properties that are added after declaration #13271
Comments
From @Spown on December 31, 2016 4:13 I think it is a proper behavior. If you had something like this: var obj = {};
if (someGlobalVariable===true) {
obj.test = {
one: 1
}
} else if (someGlobalVariable===false) {
obj.test = "I'm a string now!"
}
obj then Intellisense wouldn't really know whether the obj variable always has this |
From @saravanaj on December 31, 2016 6:26 @Spown I agree it is impossible to autocomplete properties that are added conditionally, but the example I posted does not add any properties conditionally. The same code gives intellisense in Visual Studio. The major use case where this type of intellisense is needed is when I namespace methods and properties like below: |
I verified this intellisense limitation for JS using both TS 2.1.5 and typescript@next. I believe it may be a duplicate of an existing issue but wasn't able to find a proper parent, so feel free to mark it as such if that is the case. We already handle property assignment to the |
Please note that |
This is a duplicate of #7632 |
From @saravanaj on December 30, 2016 3:8
I am running code with
--disable-extensions
flag.Steps to Reproduce:
Write some code where properties are added to objects added after declaration. Intellisense does not work:
If the properties are defined during declaration it works:
Copied from original issue: microsoft/vscode#17923
The text was updated successfully, but these errors were encountered: