angelozerr / tern.java

Use tern.js in Java context
http://ternjs.net/
Other
248 stars 52 forks source link

Tern popup hints disable JSDT JSDoc popup hints #158

Open paulvi opened 9 years ago

paulvi commented 9 years ago

When using JSDT without TernIDE, with JSDoc like below

/** base node package */
var http = require('http');
var serveStatic = require('serve-static');

when mouse-over http anywhere inside file, I would get JSDoc hint "base node package"

base-node-package

Now with TernIDE on, as a user I can't use JSDOc support feature

angelozerr commented 9 years ago

I know this problem, but how can I manage that? When hover must be displayed, it loops for IJavaEditorTextHover list (tern + jsdt). tern hover comes from the first and compute a text hover and popup displays the tern hover (without executing the jsdt text hover).

paulvi commented 9 years ago

JSDoc by itself is exciting http://usejsdoc.org/ , e.g. look at @type {typeName}

and JSDT can get types and description for some libraries, like MongoDB for node, even without understanding require

JSDoc support

Even click-through to definition click-through to definition

see http://stackoverflow.com/questions/18960201/how-to-ignore-node-shebang-error-in-eclipse

Solution may be

it loops for IJavaEditorTextHover list (tern + jsdt). tern hover comes from the first

and this is exactly design flaw of Eclipse API: what the use to have 2 or more hints when only one will be displayed. Eclipse should combine them.

angelozerr commented 9 years ago

closer integration with JSDT: is it possible to extend JSDT hint? [ ] TODO raise a bugzilla bug

I have done that, but it doesn't merge JSDT hover.

Can tern process JSDoc ?

Yes it can, but today we cannot retrieve type and JSDoc information. I have created an issue for that https://github.com/marijnh/tern/issues/409

and this is exactly design flaw of Eclipse API: what the use to have 2 or more hints when only one will be displayed. Eclipse should combine them.

Today I extend JSDT to use tern, but we could extend other JS plugins.

paulvi commented 9 years ago

I have done that, but it doesn't merge JSDT hover.

Please raise or link bug on bugzilla

angelozerr commented 9 years ago

Ok, since https://github.com/marijnh/tern/pull/420 patch was accepted, now tern is able to retrieve doc+type. I have commited last version of tern, here a screenshot :

dochover

@paulvi please test and close this issue, if it's OK.

angelozerr commented 9 years ago

@paulvi can I close this issue?

paulvi commented 9 years ago

well, now tern includes JSDoc, but the conflicting with JSDT is still on, I guess.

So let it be open.