In an MVC 4 ASP.Net project I have the following JavaScript file:
Foo = function () {
///<field name="bar" type="Foo" mayBeNull="true"></field>
this.bar = null;
}
Foo.prototype.test = function () {
this.
}
When I type the period in test()
, I get no intellisense support ("intellisense was unable to determine an accurate completion list for this expression").
If I remove the line this.bar = null;
, I get full intellisense support, but bar
has not been initialized to null
.
If I instead change the comment's type to another type, e.g. to Number
or to another declared constructor method, I get full intellisense support for that type.
If I change the initialization to this.bar = 6;
, I get intellisense support for Number
which seems reasonable.
The problem seems to be that intellisense is not able to match null
to the Foo
class, but only in the constructor method of the specified type.
Is there a way I can get intellisense to work with the null-initialization?
If I try out intellisense at the end of the constructor method, I get the following result:
The original variant gives me intellisense for this
, but the type of bar
is unknown.
If I remove this.bar = null;
, intellisense tells me that the type of bar
is Foo
, but is unable to get its members.
If I change the initialization to this.bar = 6;
, I get intellisense support for Number
.
Update
Bug report has been filed at Microsoft Connect. If you can reproduce the problem, feel free to let them know.