scala-ide/scala-ide — pull request #716 by pmellati (2014-06-06 23:06:41+00:00)
Title: Support for showing variable values in hovers when in suspended debug mode

Support for showing variable values in hovers when in suspended debug mode.

The hover shows values when hovering over local variables & class fields. Care has been taken for the hover to never show wrong values upon hover (the automated tests test this), although, I cannot rule-out possible bugs.

Some implementation details:

* The sdt.core project now exposes a new extension point (`scalaHoverDebugOverride`) that allows its text hover to be overriden by a plugin. The sdt.debug project provides an extension for this extension point.

* The main logic of this commit is implemented in the `StackFrameVariableOfTreeFinder.find(...)` method. This method takes an ast node (`compiler.Tree`) as input and (if possible) returns the `IVariable` from the stack frame that corresponds to the given ast node.

* Once an `IVariable` is sucessfully found, it is fed to the presentation component that is used internally by the jdt, which presents complex objects in a tree with collapsible sub-trees. Whenever an `IVariable` is not found, the existing implementation of text hover (the one before this commit) is used.

* Some hacks are employed in the implementation (e.g. looking for stack-frame variables that are named `"$this"` or `"$outer"`).

* The `ScalaDebugger` class now also keeps track of the currently selected stack frame.

* A test case exercises the `StackFrameVariableOfTreeFinder.find(...)` function.

Fixes #1001732