19 01 2013
Idea for code completion for Cinnamon / Gnome Shell with Gjs and GObject-Introspection
One of my biggest gripes with Gnome Shell or Cinnamon is the lack of documentation and code completion while developing. I’ve been working on a basic way that I could create code competition for myself for some of the most common functionality.
It’s a very simple, you can see an overview here: http://www.gregfreeman.io/files/cinnamon_js_docs/
The idea is to create stub classes for all of the files normally accessed with imports. Most IDEs also support JS Doc annotations. Simply by creating a docs directory in your project and adding the stub files makes code completion work with no other changes.
I find this particularly useful for using functions from the core files that GObject Introspection allows us to call so I don’t have to go hunting in C files.
It would be great to be able to create a basic stub of every function available programmatically although I haven’t delved too deep into this yet. I’ve always found http://www.roojs.com/seed/gir-1.2-gtk-3.0/gjs/ to be a good source of info for unknown functions.