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

Tern Explorer #289

Closed
angelozerr opened this issue Jun 16, 2015 · 24 comments
Closed

Tern Explorer #289

angelozerr opened this issue Jun 16, 2015 · 24 comments
Milestone

Comments

@angelozerr
Copy link
Owner

I think it should be cool that tern.java provide a "Tern Explorer" View which display JavaScripts functions, variables of the current JavaScript file like the JSDT Ouline View.

Why doing that although JSDT does that?

  • we could display a lot of information like type, variable inside a function.
  • display the acorn AST
  • displays for each frameworks some items. For instance for AngularJS displays controller, modules, etc like AngularJS Explorer, grunt/gulp tasks like Build Explorer. We could displays modules for node.js/requirejs, etc => having oen explorer to displays thoses thoses items instead of having a new view for each JavaScript frameworks.

@vrubezhny @dgolovin @mickaelistria @maxandersen @pascalleclercq @gamerson @paulvi @fbricon @piotrtomiak @jabby what do you think about that?

@mickaelistria
Copy link
Contributor

I'm not sure adding yet-another-view is a good UI solution. Instead, it would make more sense to contribute additional data to the Project Explorer (via CNF) or Outline view (via whatever works).

@angelozerr
Copy link
Owner Author

@mickaelistria I would like unify angular explorer + build explorer (gulp/grunt) and add functions, variables. If I contribute to Project Explorer or Outline View, we will have some duplicate variables (coming from JSDT and coming from Tern, (it's the same problem with completion))

@mickaelistria
Copy link
Contributor

the CNF allows filters to avoid duplicate. The Outline view probably has something similar.
I believe having those details in the Outline view is what users will expect.

@vrubezhny
Copy link
Contributor

@angelozerr, but still it is a good idea to integrate to Project Explorer and Outline View. We're going to provide a mode for JSDT that excludes any internal parsing/validation/content assisting/ And, as far as I tested, Tern.java works fine in such a mode. But Content outline is completely empty in such a mode, so your contribution to Outline View will be very welcomed.

@angelozerr
Copy link
Owner Author

the CNF allows filters to avoid duplicate.

Thanks @mickaelistria for your information.

But Content outline is completely empty in such a mode, so your contribution to Outline View will be very welcomed.

@vrubezhny glad this issue please you:) Could we work together about this issue? If you can prepare me the implementation of the extension point for Outline View + Project explorer, it will win me a lot of time and I could work for https://github.com/angelozerr/tern-outline Thanks!

@maxandersen
Copy link

please dont add more custom views when eclipse already has it.

please show up on wtp-dev with what you need instead of just fixing it in tern.

@angelozerr
Copy link
Owner Author

please dont add more custom views when eclipse already has it.

Ok @maxandersen, I have understood the message:)

please show up on wtp-dev with what you need instead of just fixing it in tern.

I fix nothing inside tern.java. I suppose you speak about WTP JSON Editor or WTP Web Resources

If it that, my goal is to try to contribute to WTP.

@angelozerr
Copy link
Owner Author

@vrubezhny if you could give me some directive to extends JSDT outline view (is it possible?), it should be cool. Thanks!

@mickaelistria
Copy link
Contributor

mickaelistria commented Jun 17, 2015 via email

@angelozerr
Copy link
Owner Author

Thanks @mickaelistria !

If you want to replace it, it will require some changes in JSDT to allow different/additional content providers

It was my fear. I think in a first step, I will create a new ViewPart "Tern Explorer" which will replace Angular Explorer and Build Explorer. Once JSDT will do some change for their outline, I will remove "Tern Explorer".

@mickaelistria
Copy link
Contributor

Ok. But don't call it "Tern Explorer", most users don't know what Tern is. A Generic "JavaScript Explorer" would probably be more intuitive.
Also, despite the Outline view requires changes in JSDT, you can still contribute your ContentProviders and co to the CNF framework to show them in the Project Explorer view. It's just a matter of adding an extension (no code necessary once you already have the providers).
Finally, if you're willing to make JSDT Outline page more extensible/customizable by rewriting it on top of CNF or other, your patches are welcome ;)

@paulvi
Copy link
Contributor

paulvi commented Jun 26, 2015

+1 for "JavaScript Explorer"

I wonder why there's no way to show the same tree in Outline and in Project Explore view.

@angelozerr
Copy link
Owner Author

+1 for "JavaScript Explorer"

Ok I will do that.

I wonder why there's no way to show the same tree in Outline and in Project Explore view.

It's my goal.

My first goal is to fill the view with variables, functions of the current file. But I would like to extend it to fill other items like angular controller, modules liek https://github.com/angelozerr/angularjs-eclipse/wiki/Angular-Explorer-View (in order to remove this view from AngularJS Eclipse).

My idea is to give the capability for each tern modules to extend the explorer. For instance for tern node module, we could display list of used node module (require). To fix http://stackoverflow.com/questions/27906867/eclipse-supporting-outline-view-with-require-js-define for instance.

Any feedback and idea are welcome!

@paulvi
Copy link
Contributor

paulvi commented Jun 29, 2015

rename issue?.. or possibly add related items. it seems now too broad a-la discussion thread

@angelozerr
Copy link
Owner Author

rename issue?

Why. This issue about developping a new ViewPart like JSDT Outline but where the treeview is filled with https://github.com/angelozerr/tern-outline

@angelozerr
Copy link
Owner Author

@vrubezhny @dgolovin @mickaelistria @maxandersen @pascalleclercq @gamerson @paulvi @fbricon @piotrtomiak @jabby I have started to implement Tern Explorer (it's the first step before integrating inside Outline and Navigator).

Here the result :

ternexplorer

On the left you can see Tern Explorer and on the right teh JSDT (which is blank because it seems that JSDT doesn't support variables declaration inside function with Outline)

I must improve again (support double click, support object literal, etc), but you if you have time, please play with Tern Explorer and gives me feedback. Thanks!

@angelozerr
Copy link
Owner Author

See https://github.com/angelozerr/tern.java/wiki/Tern-Outline-support for more infomration. You can see comparison between JSDT Outline and Tern Explorer :

@paulvi
Copy link
Contributor

paulvi commented Aug 12, 2015

Can TernExplorer content bee inside Outline instead of JSDT ?

@angelozerr
Copy link
Owner Author

Can TernExplorer content bee inside Outline instead of JSDT ?

Please read https://github.com/angelozerr/tern.java/wiki/Tern-Outline-support#why-an-another-view

I don't know how to override or extend JSDT Outline.

@paulvi
Copy link
Contributor

paulvi commented Sep 22, 2015

Will view id tern.eclipse.ide.ui.views.TernExplorerView stay the same ?

paulvi pushed a commit to Nodeclipse/nodeclipse that referenced this issue Sep 22, 2015
@angelozerr
Copy link
Owner Author

Will view id tern.eclipse.ide.ui.views.TernExplorerView stay the same ?

What is the problem with this id? In the future, I hope JSDT will give the capability to override Outline.

@paulvi
Copy link
Contributor

paulvi commented Sep 22, 2015

It is added to Node perspective in Nodeclipse/nodeclipse@b844c87

@angelozerr
Copy link
Owner Author

Ok, this id should not changed, except whe JSDT will be available to override Outline (In this case I will remove Tern Explorer)

@paulvi
Copy link
Contributor

paulvi commented Sep 23, 2015

That would be OK then.

paulvi pushed a commit to Nodeclipse/www.nodeclipse.org that referenced this issue Sep 23, 2015
paulvi pushed a commit to Nodeclipse/nodeclipse that referenced this issue Sep 24, 2015
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

5 participants