fdorg/flashdevelop — pull request #56 by DavidKarlas (2013-11-14 06:20:13+00:00)
Title: Handling member LiveDataTip of casted object

Modified GetWordAtPosition function in LiveDataTip to be able to handle (obj as MyClass).value when hovering with mouse over value member of obj object.

I started working on project that is big and alot of times there is casting like (obj as ClassName).stringValue and I have to put mouse on obj and navigate over alot of class members just to see value of stringValue. So I decided to fix this... :)

I'm not 100% if I covered all cases or if I implemented some bugs. So can someone please think abit if this is OK solution.

Previous code was not handling brackets so it would pass to java debugger ".stringValue" but now its sending (obj as ClassName).stringValue and everything works cool. I tested abit with calling method which ofcourse does not work. Any other corner cases suggestions are very welcome I can test myself...

Thank you,
David

I'm also pasting sample program that I used to test few cases...
```as3
package
{
import flash.display.Sprite;
public class Main extends Sprite
{

public function Main():void
{
var test1:TestClass = new TestClass();
test1.testString = "Should!!!NOT!!!BeSeen";
var test2:TestClass = new TestClass();
test2.testString = "ShouldBeSeen";
test1.traceObject(test2);
}
}
}
```

```as3
package
{
public class TestClass
{
public var testString:String;

public function traceObject(obj:Object)
{
trace((obj as TestClass).testString);
trace(TestClass(obj).testString);
trace((obj).testString);
trace(obj.testString);
trace((createTestClass() as TestClass).testString);
trace(createTestClass().testString);
}

private function createTestClass():TestClass {
var testObj:TestClass = new TestClass();
testObj.testString = "newTestClass";
return testObj;
}
}
}
```