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.

, , ,

One thought on “Idea for code completion for Cinnamon / Gnome Shell with Gjs and GObject-Introspection

  • Logan says:

    As someone who has had significant trouble finding documentation (http://cinnamondocumentation.wikinet.org/wiki/Main_Page seems to be my saving grace now), I definitely agree that there needs to be better documentation.

    I only figured out today that the libraries are exposed via Gjs. Do you know of any good sources/primers on Gjs so that I can figure out what all is available? I noticed even my link doesn’t have things like GLib listed, so I’d like to know how to identify which functions are available.

Leave a Reply

Your email address will not be published. Required fields are marked *