You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it is a proper behavior. If you had something like this:
varobj={};if(someGlobalVariable===true){obj.test={one: 1}}elseif(someGlobalVariable===false){obj.test="I'm a string now!"}obj
then Intellisense wouldn't really know whether the obj variable always has this test property and what type it is. Intellisense doesn't evaluate your code - it only makes assumptions where it can. Thats why you still have word suggestions:
as a compromise.
@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 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:

The text was updated successfully, but these errors were encountered: