-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-unique variable names within a container #141
Comments
Minor follow up: I ended up renaming the affected shadow variables to use otherwise illegal identifier names so that they can be differentiated in Variables results and related requests. It should probably at least be clarified if uniqueness is indeed a protocol requirement. |
@justarandomgeek what is the semantic of your first example?
|
Yes, I would expect a debugger to show all four of the There's also a tangentially related situation I occasionally see (but less often) when expanding tables because Lua allows any value to be the key to a table so you might end up with a table whose keys are all empty tables that just get called |
yes, the variable name must be unique within its container and DAP clients rely on this. Since DAP clients make no other assumptions about variable names, debug adapters are free to create "synthetic" |
I'm curious why this needs to be the case. From a quick scan of DAP, the variable name is only reused in two places, the That said I still question the utility of the request as presented. As a developer it would be more helpful to have different names like |
But having a |
The Variables type does not specify that its
name
should be unique within a cotainer, but it seems that DAP assumes that they are in several places:This is causing some problems for me, because in Lua it's perfectly valid to do something like this:
or
and I've had some complaints from users about getting "the wrong" version of redefined locals.
It seems like the protocol wants me to make a new
Scope
at every block or something like that, but i don't get enough information from the Lua runtime to do that, and in any case it wouldn't work since redefining within a block is legal anyway.The text was updated successfully, but these errors were encountered: