hashlink-debugger icon indicating copy to clipboard operation
hashlink-debugger copied to clipboard

Debugger issue : Unknown variables with local functions

Open Fl0xer opened this issue 2 years ago • 4 comments

When we are hovering the variables, the tooltip shows "Unknown variable" instead of the value of this variable.

Fl0xer avatar Nov 18 '21 14:11 Fl0xer

In the following example:

class DebuggerTest extends flash.display.Sprite { private var obj:flash.display.Sprite;

public function new() {
    super();
    obj = new flash.display.Sprite();
    obj.x = 100;
	trace(obj.x);
}

}

Hovering over obj.x reports "Unknown variable".

Is it the intended behavior or it's not supposed to happen? Is there any workaround or specific combination of versions of VS Code/Haxe/Hash Link Debugger that this works as expected?

inovento avatar Mar 03 '22 09:03 inovento

You're using flash API so I don't think that's HashLink debugger you're using here ?

ncannasse avatar Mar 04 '22 09:03 ncannasse

@ncannasse This is https://github.com/openfl/openfl + https://github.com/haxelime/lime Using HashLink Debugger indeed. In what conditions is it working for you?

inovento avatar Mar 04 '22 13:03 inovento

Here is a very simple working example with all references to flash (openfl) omitted to eliminate any confusion and possibly any collisions with other libraries:

class DebuggerTest { private var obj:Simple;

public function new(root:Any) {
    obj = new Simple();
    obj.x = 100;
	trace(obj.x);
}

}

class Simple { private var _x:Int;

public function new() {}

public var x(get, set):Int;
private function get_x():Int {
    return _x;
}
private function set_x(value:Int):Int {
    _x = value;
    return get_x();
}

}

Hovering on obj.x displays "Unknown variable". Tested with Haxe 4.1.5, HashLink Debugger v1.1.2, VS Code 1.6.5 and Hash Link 1.9.0, 1.10.0, 1.11.0.

inovento avatar Mar 05 '22 11:03 inovento