-
Notifications
You must be signed in to change notification settings - Fork 149
Open
Labels
clarificationProtocol clarificationProtocol clarification
Description
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:
- At least some implementations fail to list repeated names in a Variables response. (Related Debug Variables View does not show multiple variables from Debug Adapter when names are not unique vscode#107506)
- SetVariables request takes a name argument, which produces ambiguity (and leaves some vars inaccessible) if there are multiple variables of that name
- I'm not using Data Breakpoints yet, but DataBreakpointInfo also seems to use ref+name to identify a variable, with the same problems as SetVariables
This is causing some problems for me, because in Lua it's perfectly valid to do something like this:
local function a()
local a = 1
local a = 2
local a = 3
local a = 4
return
end
or
local function a()
local a = 1
do
local a = 2
print(a) -- uses the second a
end
print(a) -- uses the first a again
end
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.
ManuelHentschel
Metadata
Metadata
Assignees
Labels
clarificationProtocol clarificationProtocol clarification