GithubHelp home page GithubHelp logo

Comments (6)

int19h avatar int19h commented on July 29, 2024 1

I think the point is rather that the spec doesn't say that the string that's reported via value is also what's going to be passed to setVariable when user edits it in the IDE. True, the IDE is not really interpreting that string. But it's passing it from one place to another, and since it crosses the protocol boundary twice in doing so, it needs to be a part of the contract.

It's always going to be best effort, of course, because not all values have a representation that's suitable for re-evaluation. But if DAP implementations are failing to do so for something as basic as string literals, clearly it needs some nudging from the spec side.

from debug-adapter-protocol.

weinand avatar weinand commented on July 29, 2024

DAP only deals with strings rendered in the UI. The DAP does not define any "primitive types" for data (variables).

The strings are shown as is.
There is no interpretation, evaluation, quoting or escaping performed in the frontend.
This gives the DA full control over what is shown to the user, but it is an obligation too: the DA has to format the value as the user would expected them to look like in the specific language.

The "value" argument in the SetVariableArguments is again just a string that is not interpreted by the frontend in any way. It is the DAs responsibility to interpret it in a way that makes sense for the given language/debugger.

The frontend does not assume anywhere that a "foo" is a string, 123 a number, and null a special value. The values are received from the DA as ""foo"" and "123" and "null".

from debug-adapter-protocol.

vscodebot avatar vscodebot commented on July 29, 2024

This issue has been closed because it represents a question. Questions are better addressed on StackOverflow.

Happy Coding!

from debug-adapter-protocol.

hoehrmann avatar hoehrmann commented on July 29, 2024

@weinand : That is not an acceptable response. I asked that the specification be clarified. I would expect either a pointer to the part of the specification or accompanying documents where this is already explained, meaning I did not read them properly, -- or a rationale for why this does not need explaining.

from debug-adapter-protocol.

weinand avatar weinand commented on July 29, 2024

Sorry the bot closed this issue.
I properly tagged it as a "Clarification" request.

from debug-adapter-protocol.

gregg-miskelly avatar gregg-miskelly commented on July 29, 2024

One minor note: someday we might want to extend the debug adapter protocol to add a new format or context that a client can use to obtain the 'editable value' of an expression/variable. VS has this concept within our internal debugging APIs so that backends can provide one value in the normal display scenario, but then a different value when the user double clicks to edit.

from debug-adapter-protocol.

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.