Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [Dltk-dev] Teaching the Script Editors

_javascript_ has a IDesignTimeDOMProvider extention point  in org.eclipse.dltk._javascript_.core.dom.support
that can be used to add dom providers to the script editor

johan


On Thu, Aug 14, 2008 at 12:34 PM, Frerich Raabe <raabe@xxxxxxxxxxxxx> wrote:
Hi,

I'm successfully using DLTK 0.95 in my RCP application (based on Eclipse 3.4). In particular, I'm using the _javascript_, Python and Tcl modules and they look very nice. Thanks a lot to you people! :-)

However, I'm trying to augment the editors a bit. In my application, people can create scripts in either of the three languages. What I'd like to provide is auto-completion for certain preconfigured objects. For instance, the user might create a _javascript_ script which runs in a web browser. In that case, I'd like to be able to auto-complete certain properties of the 'window' object. So before the editing starts, I'd like to "teach" the editor about this.

I noticed that it works quite well if I (manually, for testing purposes) insert a variable declaration (in _javascript_, in this case) at the start, like

var window {
 location: { href: "" },
 foo: ..,
 bar: ..,
};

After typing that, the editor (the 'conciler'?) knows about the properties so I can nicely type window.<Ctrl+Space> and see the three properties. Does anybody know how I can do this automatically, from Java? Is there maybe some function to evaluate some given script code in the current editor?

--
Frerich Raabe - raabe@xxxxxxxxxxxxx
www.froglogic.com - Multi-Platform GUI Testing

_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev


Back to the top