KDE Developer
|
as you might now, I'm currently working a lot on JavaScript bindings for KWin. Both the C++ implementation and my example scripts are written inside KDevelop.
My scripting API defines a global properties and the scripts mostly operate the properties of those global variables. Is it somehow possible to get auto-completion for those known global variables? Some way to tell kdevelop how the API looks like? Btw the API can be found on techbase and is completely generated from Doxygen XML output |
Global Moderator
|
The scripts are in JavaScript, aren't they? That will probably be difficult then, because KDevelop doesn't currently have any JavaScript language support.
Greetings
I'm working on the KDevelop IDE.
|
Global Moderator
|
Thinking about it for a few days, depending on what your scripts look like it might not be that difficult to come up with something useful for your special case after all. Could you maybe post a few examples? If most of your function calls have a fixed format (like, they are attributes of some global object which always has the same name) then it could be rather easy to hack an autocompletion-only language support together. Maybe that could even be extended later.
Greetings
I'm working on the KDevelop IDE.
|
KDE Developer
|
Almost all functions have a fixed number of parameters. Without that I would not have had the idea at all
Have a look at http://techbase.kde.org/Development/Tutorials/KWin/Scripting/API_4.9 to get an idea. |
Global Moderator
|
Hi,
the problem is less the parameters, but more the way the methods are called. For example, this:
would be easy to auto-complete, while this:
wouldn't be (always talking about the active() method, i.e. having the cursor behind the dot and invoking autocompletion with the intention of calling that method). In other words, if the line always looks roughly the same and you could match it with a regex without taking the code before that line into account, then it would be easy, otherwise it would require a more-or-less functional JavaScript language support, which is a large effort to write. Greetings
I'm working on the KDevelop IDE.
|
KDE Developer
|
most of the calls are actually in a way that regex might work. And that would already be a great help to me, if it would offer a suggestion box for all that belongs to the global variables.
|
Global Moderator
|
Okay! I will think about how difficult it would be to implement a generic regular expression autocompletion plugin which you can feed with XML (or similar) data, and report back here as soon as I have an idea.
We already talked about such a plugin on IRC recently, and figured it doesn't make sense to link such a thing to kdevelop/kdevplatform, as it doesn't make use of its features. Instead, it should be a kate plugin (which would work in KDevelop, too, but also in plain kate). Optimally, I would imagine it to work with data similar to the kate syntax highlighting files. Greetings
I'm working on the KDevelop IDE.
|
Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell