Giter Club home page Giter Club logo

Comments (9)

mickaelistria avatar mickaelistria commented on June 13, 2024 1

Thanks to your hints, I can confirm that one a handler is added for setVariable, I can successfully get the set variable workflow run in Eclipse IDE.

from vscode-chrome-debug-core.

roblourens avatar roblourens commented on June 13, 2024

@EricCornelson I think that we lost a handler for this request with your refactoring.

from vscode-chrome-debug-core.

EricCornelson avatar EricCornelson commented on June 13, 2024

Got it, I'll take a look

from vscode-chrome-debug-core.

roblourens avatar roblourens commented on June 13, 2024

And @mickaelistria from the error after the handler is fixed, it sounds like variablesReference is not included which I think should be the variablesReference for the scope.

from vscode-chrome-debug-core.

mickaelistria avatar mickaelistria commented on June 13, 2024

Sorry, I'm getting a bit lost here ;).
Do you confirm the Unrecognized request: setVariable", is a bug in the debug adapter?

About the unhandledRejection after my tweak, variablesReference here is what I get as result of variables

{"seq":95,"type":"response","request_seq":12,"command":"variables","success":true,"body":{"variables":[{"name":"this","value":"Object","type":"Object","variablesReference":1015,"evaluateName":"this"},{"name":"__dirname","value":"\"/home/mistria/workspace-demo/l\"","variablesReference":0,"evaluateName":"__dirname","type":"string"},{"name":"__filename","value":"\"/home/mistria/workspace-demo/l/blah.js\"","variablesReference":0,"evaluateName":"__filename","type":"string"},{"name":"[[StableObjectId]]","value":"1","variablesReference":0,"evaluateName":"[[StableObjectId]]","type":"number"},{"name":"exports","value":"Object {}","type":"Object","variablesReference":1012,"evaluateName":"exports"},{"name":"module","value":"Module {id: \".\", exports: Object, parent: null, …}","type":"Object","variablesReference":1014,"evaluateName":"module"},{"name":"n","value":"4","variablesReference":0,"evaluateName":"n","type":"number"},{"name":"require","value":"function require(path) { … }","type":"Function","variablesReference":1013,"evaluateName":"require"}]}}

The interesting part is {"name":"n","value":"4","variablesReference":0,"evaluateName":"n","type":"number"}, and in this interesting part, I see variablesReference=0. I guess one reason is that this variable doesn't have children, but it seems to prevent the setVariable to work later.
Here is the request sent by my IDE for setVariable

{"type":"request","seq":13,"command":"setVariable","arguments":{"variablesReference":0,"name":"n","value":"5","format":{}}}

Which seems correct per se: the variablesReference re-uses the value received earlier, I just imagine this 0 retrieved from the Debug Adapter may be wrong.

from vscode-chrome-debug-core.

mickaelistria avatar mickaelistria commented on June 13, 2024

An important thing I forgot to mention: I'm using version 6.7.55 which is extracted transitively from VSCode with node-debug2 1.33.0.

from vscode-chrome-debug-core.

mickaelistria avatar mickaelistria commented on June 13, 2024

Another interesting part about this variablesReference=0 is that it's assigned to multiple variables. Here we see for instance __filename, __dirname and [[StableObjectId]] and my local n that have the same variablesReference=0. This is defintely a bug, however it doesn't seem related to the initial one about Unrecognized request: setVariable, so if you prefer, I can open a new bug for the variablesReference=0 after Unrecognized request: setVariable is resolved.

from vscode-chrome-debug-core.

roblourens avatar roblourens commented on June 13, 2024

Yeah the "unrecognized request" is our bug.

The variablesReference of 0 is misleading - it only has a "real" value for objects. Primitive values have it set to 0. For setVariable, it needs to be set to the variablesReference for the parent scope of the variable being set. Because we are just looking up a variable based on its scope and name.

from vscode-chrome-debug-core.

mickaelistria avatar mickaelistria commented on June 13, 2024

The 'variablesReferenceof 0 is misleading - it only has a "real" value for objects. Primitive values have it set to 0. ForsetVariable`, it needs to be set to the variablesReference for the parent scope of the variable being set. Because we are just looking up a variable based on its scope and name.

Thanks, that's very helpful. I may have some more questions later, but that already unblocks many things on my end.

from vscode-chrome-debug-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.