angelozerr / tern.java

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

Extension point to generate tern plugin/JSON Type definition from JavaScript sources #323

Open angelozerr opened 9 years ago

angelozerr commented 9 years ago

Tern is able to analyse any JavaScript files sources to provide completion, hyperlink, hover, refactoring, but in some cases it is better to have a tern plugin/JSON Type definition :

var f = require('fs')
f. // here f has file system type

It exists several mean to generate tern plugin/JSON Type definition from JavaScript sources like:

It should be cool, that tern.java provides an extension point for those each generator. After that, user will able to select a folder, click on right button to have a menu Tern -> Generate, it opens a Wizard Page and user can select a generator. The click on Finish button of this wizard generate tern plugin/JSON Type Definition and install the generated tern plugin/JSON Type Definition in the tern repository and update the .tern-project.

With this feature, user will able to:

@demonfiddler what do you think about this feature? Could you be interest with this extension point to generate your own tern module with your generator (XSD, etc).

demonfiddler commented 8 years ago

Thanks, @angelozerr this would ceratinly be a useful addition to the Tern IDE toolset. BTW my apologies for the delayed response - too many things happening at once here.

In our own particular case we've already (partially) solved the problem of how to generate the JSON definition, since this must necessarily be done as part of our automated Maven build rather than manually in an IDE.

angelozerr commented 8 years ago

Thanks @demonfiddler for your answer. I will wait to see if a lot of people could be interested with this feature to implement it.