Making a code completion plugin for qtcreator, any beginner's help?
Meai last edited by
Hi, I set up the "hello world" plugin and I'm able to debug it. Right now I'm looking at these huge undocumented API's (http://doc.qt.nokia.com/qtcreator-extending/codeassist.html) and it seems to me that I'm pretty much required to read the entire qtcreator source code if I want to understand how to do a plugin. I'm new to Qt, I can't even find the TextEditor.h file and how to include it.
I just want to be able to do the exact same thing as qtcreator does for c++ (I don't care about the look and shape of the popup...), except fill it up with different info when targetting a different language. (Google Go in this case)
I'll get the info from Gocode, so the only remaining thing is:
How do I create a popup and at which location in the source? Any small samples in that direction? There don't seem to be any existing autocompletion plugins open sourced.
I guess the docs are largely unfinished here: http://doc.qt.nokia.com/qtcreator-extending/creating-plugins.html
Yes, our plugin documentation is rather outdated. Qt Creator changes rather fast and since we do not promise any kind of compatibility we don't bother to document too much either to avoid the impression that any of the APIs we use internally are stable to any degree.
So how can you find your way around? I am afraid there is no way around reading a lot of source code and/or asking on IRC (#qt-creator on the freenode network) or the mailing list. Code navigation in creator also helps: Just type "Ctrl-K" and then type "c TextEditor" to open the TextEditor class. There is little need to know where the file is actually located.
The GLSLEditorEditable class as well as the QmlJSEditorEditable are most likely good places to get started (found those by pressing "Ctrl-Shift-T" on the BaseTextEditor class) as those are real editors but less complex than the C++ one. I never really worked with the editor code though, so I can be wrong:-)