Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » JSDT "Open Declaration" NOT WORKING for JsDoc "hints". OK if type is inferred. A
JSDT "Open Declaration" NOT WORKING for JsDoc "hints". OK if type is inferred. A [message #895658] Sat, 14 July 2012 06:03 Go to next message
Alexandru Cristu is currently offline Alexandru Cristu
Messages: 3
Registered: July 2012
Junior Member
Hello,

Please see the 2 simple js sources below.
While editing tmp2.js, autocomplete works for both parameter p and for "new F()".
However "Open Declaration" does not work for parameter p, while it works as expected for "new F()".

Please advice!



/// tmp1.js ////////////////////////////////////////
function F() {
this.method = function () {

};
this.meth2 = function () {};
}

/// tmp2.js ////////////////////////////////////////
/**
* @param {F} p
*/
function b(p) {
p.meth2();
new F().msethod();
}
Re: JSDT "Open Declaration" NOT WORKING for JsDoc "hints". OK if type is inferre [message #895659 is a reply to message #895658] Sat, 14 July 2012 06:08 Go to previous messageGo to next message
Alexandru Cristu is currently offline Alexandru Cristu
Messages: 3
Registered: July 2012
Junior Member
I'm running:


Eclipse Java EE IDE for Web Developers.

Version: Juno Release
Build id: 20120614-1722


which contains org.eclipse.wst.jsdt.core_1.1.201.v201203071941.jar
Re: JSDT "Open Declaration" NOT WORKING for JsDoc "hints". OK if type is inferre [message #895660 is a reply to message #895659] Sat, 14 July 2012 06:15 Go to previous messageGo to next message
Alexandru Cristu is currently offline Alexandru Cristu
Messages: 3
Registered: July 2012
Junior Member
Just to be sure I'm clear enough...

By "Open Declaration for parameter p" I mean trying to access the declaration of meth2 in class F.
Eclipse shows in the status bar: "Current text selection does not resolve to a JavaScript element".

Same operation on method "method" in class F called from "new F().method()" navigates to tmp1.js and to the method declaration.


Since auto-complete works in both cases, JSDT recognizes that parameter p is of type F, but why doesn't it navigate to the declaration?

Thanks,
Re: JSDT "Open Declaration" NOT WORKING for JsDoc "hints". OK if type is inferre [message #895789 is a reply to message #895660] Mon, 16 July 2012 00:39 Go to previous message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2232
Registered: July 2009
Senior Member
F is p's type; it isn't p. It sounds like you've already navigated to the origination of p. If you want to navigate to the declaration of F, select a reference to F, not a reference to p.

---
Nitin Dahyabhai
Eclipse WTP, IBM
Previous Topic:Can jsdt work well with jsp in eclipse 3.5.2?
Next Topic:New XML file wizard and schemaLocation
Goto Forum:
  


Current Time: Tue Jul 22 19:47:05 EDT 2014

Powered by FUDForum. Page generated in 0.10733 seconds