You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Debug: investigate how to present inline values in source when stepping through code #12256
on a stopped event the source boundaries of the top scope are determined (the CDP protocol provides this information automatically, v8 does not)
beginning with the start line of the scope:
for every line variables and parameters are detected by fuzzy parsing and matched against variables available in the scope from the variables view.
for the first n variables of a line a one line 'preview' is added at the end of the line with a different background color
the process stops just before the line where the runtime is stopped
VS Code could implement this feature almost completely based on the existing mechanisms and protocols.
There are two tricky areas:
finding the source boundaries for a scope requires language knowledge if the boundaries are not returned from the debug adapter as part of the scope object. For now we ignore this because node-debug2 doesn't have that problem.
finding variables in a line can be done by fuzzy parsing (similar to what we already do for the variable hover). False positives could be eliminated by verifying them against the variables returned from the debug adapter for the scope.
Proposal:
in the debug protocol add a scope boundary (start, end position) to the scope object.
implement this in node-debug2.
VS Code starts to use that information to fix the hover experience by only showing a hover when inside the scope boundaries.
node.debug2 and (node-debug) implement the one line 'preview' for objects and arrays. This is not a new protocol request but just improves what's get returned as the valueattribute in a Variables request for objects and arrays.
VS Code implements the 'show inline values' feature as outlined above
So for an object, the adapter will return { name: "myObj", variablesReference: 1000, value: "Object { abc: 123 }" } as part of the response to variablesRequest, and the adapter will find the location to display myObj = Object { abc: 123 }? Sounds good to me. It should be easy to generate this preview.
roblourens yes, correct. And the object 'preview' feature is independent from the 'present inline values'. The preview will be useful in the REPL and the Variables view as well.
Activity
weinand commentedon Sep 23, 2016
Dev tools show inline values as follows:
VS Code could implement this feature almost completely based on the existing mechanisms and protocols.
There are two tricky areas:
Proposal:
valueattribute in a Variables request for objects and arrays.Isidor Nikolic (@isidorn) roblourens please provide feedback
/cc Erich Gamma (@egamma) Kai Maetzel (@kieferrm)
roblourens commentedon Sep 23, 2016
So for an object, the adapter will return
{ name: "myObj", variablesReference: 1000, value: "Object { abc: 123 }" }as part of the response to variablesRequest, and the adapter will find the location to displaymyObj = Object { abc: 123 }? Sounds good to me. It should be easy to generate this preview.weinand commentedon Sep 23, 2016
roblourens yes, correct. And the object 'preview' feature is independent from the 'present inline values'. The preview will be useful in the REPL and the Variables view as well.
roblourens commentedon Sep 23, 2016
Genau!
weinand commentedon Oct 19, 2016
See microsoft/vscode-debugadapter-node#78 for the corresponding protocol addition.