Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [Dltk-dev] Teaching DLTK about third party APIs (for completion)

_javascript_ already has that see the IDesignTimeDOMProvider interface and extention point  in org.eclipse.dltk._javascript_.core.dom.support project

We have our own complete dom tree where code completion works on

johan



On Tue, Apr 7, 2009 at 15:36, Clemens Anhuth <clemens@xxxxxxxxxxxxx> wrote:
Hello everyone.

I have asked a few questions regarding this topic on the newsgroups eclipse.technology.dltk, but the low traffic in comparison to this mailing list seems to suggest that this is the place, for time the being.



The problem I am trying to solve is this:

I would like to have DLTK offer code completion for third party APIs, and in part in a way that is language agnostic, because the APIs are offered almost identically for Python, _javascript_ and Tcl.

(These APIs are not implemented in any of these script languages. So the situation is similar to different extensions in JScript/_javascript_ depending on whether you use it in Excel or WSH, or Adobe Indesign - these "other" APIs are "just there".)



Approach #1:
I can achieve the desired completion functionality in DLTK by adding a *.js file to a DLTK _javascript_ project, given that the additional *.js file contains all type and variable declarations, classes, their methods, etc.

Approach #2:
I can also achieve the desired functionality by adding completion proposal computers for each language, but I would have to implement parsing, etc. myself then, which is what I would want to avoid.



But instead of going through completion proposal or adding an artifical "interface declaration file" I would much rather feed the underlying data structures directly with the functions, global variables, class, methods, etc. myself. I tried stepping into the completion code as well as the parsing triggered by AbstractASTFoldingStructureProvider, but cannot make much sense of the code.

For now I would be happy with hacking DLTK/_javascript_ so that it would parse my "interface declaration file" (written in _javascript_) although it doesn't appear in the list of project files, but I don't know where in the code.

Ultimately I would like to feed directly into the respective DLTK data structures to make my declarations without going through the extra step of parsing an external file, but, here too, I don't know where in the code that would be achieved.


Has teaching third party APIs to DLTK been given any thought yet? Has anything been implemented that I could already use right away? How would you like to see this implemented (if not done yet)?

Can any of you provide any pointers where to look in the code for either of these approaches?



With best regards

Clemens Anhuth



--
www.froglogic.com - Squish - Multi-Platform GUI Testing

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


Back to the top