Posts Tagged ‘debugger’

Debugger Evaluate Expression Enhancements

Monday, September 14th, 2009

Say, you hit a breakpoint in Java code:

And you cleanly see that component is a label:

You now want to investigate label internals via Evaluate Expression (Alt+F8), e.g. invoke its getText() method, but component declared type is Component and it does not have this method! The only way out is to use Surround with run-time type (Ctrl+Alt+T) first to cast it to JLabel and only then completion becomes available:

Not anymore it isn’t. IntelliJ IDEA tries to help with casting wherever possible, so you can now get the same results using Basic code completion (Ctrl+Space) only:

…press Enter and the cast is done for you:

Needless to say, it works with Smart completion (Ctrl+Shift+Space), too. It works even for complex expressions with method calls. Note, that method evaluation can take a lot of time, not to mention the possible side effects, so evaluating expressions every time you hit completion is not so nice. This is why you need to press the same shortcut twice to get the run-time type variants. That’s what you’re going to see at the bottom of completion list:

And you can play with all this now!

Debugging JavaScript in Mozilla Firefox

Monday, June 29th, 2009

IntelliJ IDEA 9M1 supports debugging of JavaScript code in Mozilla Firefox. Just create a JavaScript Debug configuration, select Firefox from the Browser list and click OK:

IntelliJ IDEA automatically installs plugin for Mozilla Firefox and executes the configuration.
Note that you need to clear Make option under Before launch group before starting debugger to work around a bug that will be fixed in next Maia EAP.

On-demand Tooltip for Values in Debugger

Wednesday, June 3rd, 2009

In Maia you can quickly look up a value in a debugger session by hovering your mouse over it (which is very handy for text values, for example):


When you need to browse through a large tree of values, this popup can be set to appear only after you invoke it.


The trick is that it is still viewable, but only when you hover mouse over a value holding the Alt key. Hitting Alt when the popup is open hides it — but that’s what you probably have already guessed.

There is also an option in the Settings dialog: