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

Support for external completion. #318

Open
angelozerr opened this issue Apr 19, 2014 · 2 comments
Open

Support for external completion. #318

angelozerr opened this issue Apr 19, 2014 · 2 comments

Comments

@angelozerr
Copy link
Contributor

I have already posted my idea at https://groups.google.com/forum/#!topic/tern-dev/Na21DTqfYfo but I think my explanation was bad.

My idea is to support completion coming from an external scope like:

  • document.getElementById(' // here ctrl+space shows html ids
  • require(' // here ctrl+space shows node modules
  • db. // here ctrl+space shows mongo databases

Those completion must be managed by an external process (not with tern), but it should be very cool if the json result of tern completion could return a new info like

external : "findHTMLIds"

to tell that completion must be done for HTML ids with external process.

Tern def could look like this

"getElementById": {
    "!type": "fn(id: string) -> +Element",
    "!external": "id->findHTMLIds"
},
@marijnh
Copy link
Member

marijnh commented Jun 6, 2014

This is an interesting direction, but currently Tern can't tell you anything about the type of an argument based on the function that is being called, because information flows from such an argument value to the type of the function, and not the other way around.

Also, this is not a priority for me, and not something I plan to work on myself.

@angelozerr
Copy link
Contributor Author

Many thank's @marijnh for your clarification. This feature is often provided by IDE like Eclipse, IntelliJ IDEA, Nebteans. Hope one day we could 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