Dash-to-panel: [not an issue] Extension development questions

Created on 4 Feb 2017  路  3Comments  路  Source: home-sweet-gnome/dash-to-panel

Hi @jderose9,

This is not an issue, I am just wondering what tools you are using for development and debugging of your extension?

I tried developing gnome-shell extensions before, created a simple timezone extension based on moment.js which I never published, but that was a very frustrating experience since there was virtually no documentation and no way to debug your code. I had to change a line of code, add log statement and restart the whole shell every time :(

I could help addressing some of the issues if it was easier.
Maybe other developers here can share their experiences here too.

My questions are:

  1. What editor/IDE you are using?
  2. Is there a way to attach a debugger? (this extension is pretty big, can't imaging debugging it with log(...) statements)
  3. Where do you check the documentation for the methods you use in your extension?
  4. Is there a way to monitor all extension/globally emitted events in real time or log it? (maybe via gnome looking glass app?)

Thank you, Jason!

question stale

Most helpful comment

Unfortunately, I don't have a lot of great answers for you.

  1. For laying out the settings UI I use Glade to open the Settings.ui file. For the javascript, I use Visual Studio Code. I use it on other projects and on other platforms so I am familiar with it. It doesn't have any features specific to gnome shell.

  2. The only reference I've ever seen to attaching a debugger is here:
    https://wiki.gnome.org/Projects/GnomeShell/DebuggingJavaScript

    I haven't tried it yet. You have to connect from another computer or virtual terminal to stop at a breakpoint, otherwise you would be pausing execution of the desktop environment you are using. I'd like to give this a shot soon though.

    I use calls to log() and monitor them and exceptions by keeping a terminal open with this command running:
    journalctl /usr/bin/gnome-shell -f -o cat

    I also use Looking Glass (Alt F2 -> "lg") to issue commands real time (usually to test something out before actually putting it in the extension code) and to inspect the UI elements.

    Whenever I make a code change, I run "make install" to deploy it and then restart gnome shell (Alt F2 -> "r")

  3. Gnome shell doesn't have any documentation that I am aware of. You just have to read the code. I just keep a 2nd instance of VS Code running with the gnome-shell repo open.

    The rendering of the UI is managed with Clutter. There is API reference documentation here but it's fairly sparse:
    https://developer.gnome.org/clutter/1.26/

  4. I'm not sure. It may be possible to wrap the existing event handling code in the ClutterActor prototype to log them, but I haven't tried that. One issue is that the gnome javascript is a wrapper around C code and you can really only access what has been exposed.

If you learn about any improvements on this process, please share :)

All 3 comments

Unfortunately, I don't have a lot of great answers for you.

  1. For laying out the settings UI I use Glade to open the Settings.ui file. For the javascript, I use Visual Studio Code. I use it on other projects and on other platforms so I am familiar with it. It doesn't have any features specific to gnome shell.

  2. The only reference I've ever seen to attaching a debugger is here:
    https://wiki.gnome.org/Projects/GnomeShell/DebuggingJavaScript

    I haven't tried it yet. You have to connect from another computer or virtual terminal to stop at a breakpoint, otherwise you would be pausing execution of the desktop environment you are using. I'd like to give this a shot soon though.

    I use calls to log() and monitor them and exceptions by keeping a terminal open with this command running:
    journalctl /usr/bin/gnome-shell -f -o cat

    I also use Looking Glass (Alt F2 -> "lg") to issue commands real time (usually to test something out before actually putting it in the extension code) and to inspect the UI elements.

    Whenever I make a code change, I run "make install" to deploy it and then restart gnome shell (Alt F2 -> "r")

  3. Gnome shell doesn't have any documentation that I am aware of. You just have to read the code. I just keep a 2nd instance of VS Code running with the gnome-shell repo open.

    The rendering of the UI is managed with Clutter. There is API reference documentation here but it's fairly sparse:
    https://developer.gnome.org/clutter/1.26/

  4. I'm not sure. It may be possible to wrap the existing event handling code in the ClutterActor prototype to log them, but I haven't tried that. One issue is that the gnome javascript is a wrapper around C code and you can really only access what has been exposed.

If you learn about any improvements on this process, please share :)

@micheleg on #75 posted this link about the possibility of a GJS debugger coming for 3.26:

https://ptomato.wordpress.com/2017/04/28/gjs-whats-next/

I'm keeping my fingers crossed!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LeeGDavis picture LeeGDavis  路  6Comments

BetaConnector picture BetaConnector  路  5Comments

alex285 picture alex285  路  6Comments

ErwinBaeyens picture ErwinBaeyens  路  5Comments

Rawleenc picture Rawleenc  路  6Comments