tomblind / local-lua-debugger-vscode

Local Lua Debugger for VSCode
MIT License
107 stars 26 forks source link

Allow inspecting upvalues of a closure #70

Open sewbacca opened 2 years ago

sewbacca commented 2 years ago

Objects are poor mans closures, or was it the other way arround? Anyways, I would like to inspect upvalues in closures. I made a semi functional version, which proofs the concept viable. However I am not familiar enough with the project to quickly add everything to make it work. It looks nice and dandy, until inspecting the upvalue: grafik The issue is, the debugger expects the value to be a table and tries to index by upvalue. I am not doing any magic, just reusing your getUpValues function, so the solution would be to detect whenever it is a function, and ask for the upvalues in a different way. Maybe if I get enough time on my hand, I will open a pull request. In the meantime you can view the changes I made here.