it appears in the code completion as a member variable rather than a method. What is the Correct Way to stub out class functions so that they'll appear in code completion correctly.

2)
The JSDoc does not appear from the JS comments. Do I need to generate the HTML?

3)
A fierce dedication to the Pope.

4)
How can I convince the JS editor that a particular function will always return a given type? If foo.bar() always returns a "baz", how do I let the world know so that code completion will work on the returned "baz"?

5)
There is no problem number five.

6)
Is there a way to associate a library files programmatically? Our ultimate goal is to create our own project type that will always have the JS nature with our own object model already "attached".]]>Mark Storer2010-06-07T17:36:42-00:00Re: JS Library stubs, JSDoc, and librarieshttps://www.eclipse.org/forums/index.php/mv/msg/169582/629951/#msg_629951
> In a project with the JS nature, I've created a demo stub library with
> some JSDoc comments for testing purposes. I'm having two issues.
>
> 1)
>
> When I define a function as
> foo.prototype.bar = function( param ) {
> ...
> };
>
>
> it appears in the code completion as a member variable rather than a
> method. What is the Correct Way to stub out class functions so that
> they'll appear in code completion correctly.

I get a correct proposal when I first define what the prototype is in
Helios SR1:
foo.prototype = new Object();
foo.prototype.bar = function( param ) {

};
new foo().|

Do you not?

> 2)
> The JSDoc does not appear from the JS comments. Do I need to generate
> the HTML?
>
Appear where? Which comments do you mean?

> 3)
> A fierce dedication to the Pope.
>
Not sure I can help there.

> 4)
> How can I convince the JS editor that a particular function will always
> return a given type? If foo.bar() always returns a "baz", how do I let
> the world know so that code completion will work on the returned "baz"?

> 5)
> There is no problem number five.
Not sure I can help with that, either.

> 6)
> Is there a way to associate a library files programmatically? Our
> ultimate goal is to create our own project type that will always have
> the JS nature with our own object model already "attached".

It sounds like you want to make use of the
org.eclipse.wst.jsdt.core.JsGlobalScopeContainerInitializer extension
point, which will let you create a reusable container in a plug-in of
your own for placing your files onto the Include Path. The
org.eclipse.wst.jsdt.support.firefox plug-in does nothing *but*
contribute such a container, making it a very good example.