Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
angelozerr opened this issue Sep 17, 2015 · 2 comments

Comments

@angelozerr
Copy link
Owner

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 :

  • when the JavaScript framework is complex and provides complex feature like node.js require function which returns a special type according parameter id:
var f = require('fs')
f. // here f has file system type
  • when there are a lot of JavaScript files, tern can takes some times to analyse those JavaScript files.

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:

  • generate a tern plugin//JSON Type Definition for her version of the JavaScript frameworks that it uses.
  • improve performance when tern starts when there are a lot of JavaScript files (because the analyse of JavaScript files is already done, but it means that if he changes the JavaSCript sources files of the framework, it will need to regenerate it).

@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
Copy link
Contributor

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
Copy link
Owner Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants