After first couple of days I’m starting to get an inkling of the outcome of the project. The basic thought is to provide in convenient way all the information about methods one has to constantly Google. It doesn’t get much more straightforward than being able to hover over the method you are writing and getting a little clue, similarly to the Visual Studio Code.
We need two things to make this happen, source where to find the information and an object to present it in. One place to get the infromation is throught the documentation that is already accesable throught GNOME Builder in the right panel. The URIs to the individual documentation pages and their keywords (such as the name of the methods) are already imported thanks to Devhelp. For a simple way to then get a text on hover is using the GtkToolTip.
The styling of the tool tip is very limited and so far the presented information can get bit messy especially when the description doesn’t fit on one line.
The styling is not the main limit, the tool tip is also not clickable because of the simple reason it disappears when you move the cursor. My vision is to make the documentation card bit more interactive. Due to getting information from the documentation we have a lot more information about the methods than just the input and output types.
Showing all the information just on hover might be bit too much so the card could have a expand button to show more to user and if even that is not enough of information refer the user to the documentation itself. So for the next part of the implementation I would like to work on hover provider that would be more inclined to customisation and could be used later by more features.
The implementation of this simple documentation card can be found here, even though it’s in it beginning stages I already found it quite practical. If the card doesn’t want to show up, you might want to check the right panel if you actually have the documentation. I haven’t found a centralized system for all the documentation but if you install a package *-doc the specific library it will be automatically added to your Builder through Devhelp, for instance:
- GTK+ 3 Reference Manual
- GAIL Reference Manual
- GDK 3 Reference Manual
- GLib Reference Manual
- GIO Reference Manual
- GObject Reference Manual
- WebKitGTK+ Reference Manual