Repository navigation
Tern Explorer #289
Description
Activity
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).
@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))
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.@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.
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!
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.
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.
@vrubezhny if you could give me some directive to extends JSDT outline view (is it possible?), it should be cool. Thanks!
- It's up to the JSDT editor to contribute content to the Outline: https://wiki.eclipse.org/FAQ_How_do_I_create_an_Outline_view_for_my_own_language_editor%3F For JSDT, here is the implementation: http://git.eclipse.org/c/jsdt/webtools.jsdt.core.git/tree/bundles/org.eclipse.wst.jsdt.ui/src/org/eclipse/wst/jsdt/internal/ui/javaeditor/JavaOutlinePage.java?id=396d55a37c164ad743dfd9f59c06ba49f25211d3 If you want to replace it, it will require some changes in JSDT to allow different/additional content providers, label providers and filters. Since this is the same pattern as content navigator extensions, it would make sense to actually make the outline view a CommonViewer (see CommonNavigator#createPartControl) and to bind specific providers to this viewer. It's actually some more work, but I don't think it's too difficult to do, and the benefits on longer term seems very worth it.
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".
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 ;)+1 for "JavaScript Explorer"
I wonder why there's no way to show the same tree in Outline and in Project Explore view.
+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!
rename issue?.. or possibly add related items. it seems now too broad a-la discussion thread
- added a commit that references this issue
on Aug 6, 2015 4 remaining items
@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 :
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!
- added a commit that references this issue
on Aug 10, 2015 See https://github.com/angelozerr/tern.java/wiki/Tern-Outline-support for more infomration. You can see comparison between JSDT Outline and Tern Explorer :
Can TernExplorer content bee inside Outline instead of JSDT ?
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.
Will view id
tern.eclipse.ide.ui.views.TernExplorerViewstay the same ?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.
It is added to Node perspective in Nodeclipse/nodeclipse@b844c87
Ok, this id should not changed, except whe JSDT will be available to override Outline (In this case I will remove Tern Explorer)
That would be OK then.


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?
@vrubezhny @dgolovin @mickaelistria @maxandersen @pascalleclercq @gamerson @paulvi @fbricon @piotrtomiak @jabby what do you think about that?