Intellisense & Outline is not correct with javascript, IDE didn't know existence of a, b functions in MyClass.

I have a code as in below:

var MyClass = function(){};

var $p = MyClass;

$p.prototype = {

     a: function(){},

     b: function(){}

};

Result: IDE didn't know existence of a, b functions in MyClass.

2 comments
Comment actions Permalink

IMHO it is a VERY strange way of updating prototype of an object....

Why you using "var $p = MyClass;" here?

0
Comment actions Permalink

It is because sometime I need develop a class with long namespace, like this:

AddInFramework.AddInManager.ObjectBuilder.BuiltInTypesBuilder = function(){};

So I want to have a short-cut to this class and hope that IDE can understand what I want, like this:

var $builder = AddInFramework.AddInManager.ObjectBuilder.BuiltInTypesBuilder = function(){};

$builder._dynamicfn = function(){};

$builder.canBuild = function(){}

$builder.prototype = {

     build: function(){}

};

In Spket IDE: although it doesn't support in Outline but it has a good intellisense.(pls see an attached image)



Attachment(s):
LongNamespace.png
0

Please sign in to leave a comment.