ActiveState Powered by ActiveState

ActiveState Community


"Add to watch" from editor

Posted by cheesegrits on 2007-10-26 09:16
OS: All / Any

OK, Extension People ...

How would I create a right button menu item for the editor which would "Add this variable to the debugger watch list"?

This would really help while I wait for PHP variable sorting to work (hint hint).

-- hugh

Heh
ToddW | Fri, 2007-10-26 14:52

You'd need to make an extension for this. You need to create an overlay, which adds a menu item to menupopup with id "editorContextMenu". Then using JS code you could get the word under the cursor:

var word = ko.interpolate.getWordUnderCursor(ko.views.manager.currentView.scimoz);

Then you need to add a watch variable, something with the debugger session tab manager I'd think...

Cheers,
Todd

cheesegrits | Fri, 2007-10-26 15:35

Ah, I think I may have inadvertently given the impression that I know what I'm doing when I said "How would I create ...".

What I actually meant was "How would YOU create ...", given that I don't even know how to cook an Overlay, let alone catch one. Hoping that some kind soul would say "Here, load this". :)

However, I shall do my best to wrap my brain around building my first extension. It's time I learned, anyway, and I'm sure it will open up entire new worlds of Komodo possibilities.

-- hugh, aka "A Bear of Very Little Brain"

cheesegrits | Sun, 2007-10-28 14:36

OK, I give up. I did try, honest.

Maybe I might could get a little further if I could find the mysterious komodo.xul referred to in the "Extensions for Klutzes" FAQ at:

http://community.activestate.com/faq/komodo-4-0-extensions

It doesn't seem to exist in 4.2 ... ?

I was hoping thats where I'd find the definitions for the "debug session tab manager" you mentioned.

-- hugh

cheesegrits | Mon, 2007-10-29 10:57

I'm still banging my head on this one. I just don't seem to be able to find the XUL definitions for Komodo itself. Either the FAQ needs updating, or I'm having a serious brain burp!

-- hugh

ToddW | Mon, 2007-10-29 11:25

You will find all the xul files are zipped up into a komodo.jar, so you'll need to unzip it, i.e.:

cd <komodo_install>/lib/mozilla/chrome
mkdir extracted
cd extracted
unzip ../komodo.jar

Then you should see the "komodo/content/komodo.xul" file.

cheesegrits | Mon, 2007-10-29 12:02

Mutter mutter jar-schmar xul-schmul mutter ...

[Smacks self in forehead]

Thanks!

-- hugh

-->