Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [wtp-dev] Support other forms of function definitions in javascript outline view

Thank you very much, I'll continue the discussion there

Jacek Pospychala wrote:
hi Moataz,
this is good catch. Because of that bug, reading some more complicated javascript code is a bit of pain. Couple days ago I opened a similar bug for that, you might find interesting to vote or comment:
298062: InferEngine could better detect fields
https://bugs.eclipse.org/bugs/show_bug.cgi?id=298062

I'm not an expert, but probably instead of evaluating javascript source line by line, we should rather follow it's control flow to better infer how fields and functions are being created in runtime, because after all javascript is dynamic language.


cheers

Jacek


Moataz Elmasry wrote:
Hello List

in the "outline" view of a js file, classes and functions are shown correctly, if I defined them as follows:

function Class1() {
    function func1() {}
}

Now if I defined the above structure in a different way, for example:

function Class1(){}
Class1.prototype.func1 = function(){}

or:

function Class1() {
    func1 : function() {}
}

Then the functions won't be displayed in a readable way. i.e. I expect to see in the outline Class1 then func1 as a subtree/subelement, which is not the case in the last two definitions We find such definitions often, especially the last one, for example in js frameworks like jquery and OpenLayers.

Now my question is, can wtp display such fnction definition, if not then I'd love to add this as a feature request in the issue trakcer, what do you think? (and yes I know its an implementation hell, but who knows, maybe someone will want to implement it years from now :) )

Best regards
Moataz
_______________________________________________
wtp-dev mailing list
wtp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/wtp-dev

_______________________________________________
wtp-dev mailing list
wtp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/wtp-dev



Back to the top