Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [orion-dev] Consuming javascript/finder from code edit widget

Hi Libing,

I will open a bug as soon as I am back from my vacation (i.e. two weeks from now). In the meantime:

Regardless of whether this specific module is requirable, I guess the more general question would be „Is it possible to do computations based on the current AST, either directly or by querying the tern worker?“ I am hoping to get type and scope information from that, especially at the current cursor position.

My main two use cases are:

1. Better navigation to our help system (via a keyboard shortcut). If I know the type and the member, I can link directly instead of doing a search for the current word. This way I could also distinguish between our own types and JS types and link to MDN for the latter.
2. We are currently working on a debugger which runs on the server. If a breakpoint is hit, the values of all variables are sent to the client which generates a tree view. It would be nice to also provide a hover service to show the current value of a variable, but the hover service only gets the current position in the text, as far as I understand. So if I were able to query the AST/Tern, I could map hover positions to variables and show the value.

Regards,
Sebastian

P.S.: We are still experimenting with the debugging, so maybe we can solve this problem by ourselves by just sending the source positions along, but you never know...


> Am 28.12.2015 um 21:43 schrieb Libing Wang <Libing_Wang@xxxxxxxxxx>:
> 
> Hi Sebastian:
> With the current structure of the  build, unfortunately the answer is no but we can rethink about it. 
> As you may already know, the javascript plugin is one of the separate plugins that we delivered as the "internal plugins" with the code edit widget core. It has only the almond build, not the requirejs build.
> 
> For the possibility to consume the javascript/finder module directly, I am not the person who can provide you the exact answer right now but I will discuss this with our javascript tooling experts after the New Year holidays.
> In order for us to understand your request better, could you please open a bug, elaborating the followings?
> 1. Your code style to consume the module. We had similar discussions on the widget core(the requirejs build) and I assume your coding style will be similar?
> 2. A simple text contents of a file that you will search on. 
> 3. What parameters you want to pass and what return value you expect, based on the example from 2.
> 
> We will then decide if we can support your needs.
> 
> Regards,
> Libing
> 
> 
> 
> From:        Sebastian Pahnke <pahnke.sebastian@xxxxxxxxx>
> To:        Orion developer discussions <orion-dev@xxxxxxxxxxx>
> Date:        12/20/2015 11:38 AM
> Subject:        [orion-dev] Consuming javascript/finder from code edit widget
> Sent by:        orion-dev-bounces@xxxxxxxxxxx
> 
> 
> 
> Hi,
> 
> is it possible to use the javascript/finder module from the code edit widget? I would like to use the function 'findNode' to improve the navigation to a help website for my own types. Right now I’m computing the word the cursor is on and, using that, search the help system. But this often returns ambiguous results, given that it’s a simple text search oblivious of types. It may also help me with another task.
> 
> Regards,
> Sebastian
> _______________________________________________
> orion-dev mailing list
> orion-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://dev.eclipse.org/mailman/listinfo/orion-dev
> 
> _______________________________________________
> orion-dev mailing list
> orion-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://dev.eclipse.org/mailman/listinfo/orion-dev



Back to the top