Skip to content

Copy value from the Debug view adds " around the string content #1990

Closed

Description

@escamoteur

When trying to copy the value from a String variable / field from the Variable or Watch view and you paste it somewhere the content of the value is surrounded by double quotation marks ".

This is especially annoying if you want to copy an url from a variable to the web browser.

Activity

  1. added
    in debuggingRelates to the debug adapter or process of running debug sessions
    on Sep 16, 2019
  2. added this to the v3.5.0 milestone on Sep 16, 2019
  3. DanTup commented on Sep 17, 2019

    @DanTup
    Member

    Hmm, I'm not sure what to do here. The behaviour is consistent with other languages like TypeScript. It copies the same value that it shows in the watch list, and that has quotes so you can tell the difference between a string and a number (for example):

    Screenshot 2019-09-17 at 1 55 29 pm

    Someone opened a PR in VS Code for "Copy Raw Value" but it was closed as something extensions should do, once an API has been implemented to support it:

    microsoft/vscode#71666

    So I think it would probably be better to implement an additional option once that's provided (it also would allow literal newlines instead of \n etc.).

  4. modified the milestones: v3.5.0, Backlog on Sep 17, 2019
  5. escamoteur commented on Sep 17, 2019

    @escamoteur
    Author

    It makes sense in the display to add quotation marks but not when you want the value. Could you not just strip the quotes when copying?

  6. DanTup commented on Sep 17, 2019

    @DanTup
    Member

    We don't do the copying, it's all VS Code. We tell it the value (which we've wrapped in quotes) and it uses it both for display and copying. A lot of VS Code is like that - we don't really get to control behaviour in the UI, VS code just asks us for data and we provide it, and it controls things like this (which is good in many ways, but also limiting in others!).

  7. escamoteur commented on Sep 17, 2019

    @escamoteur
    Author
  8. DanTup commented on Sep 17, 2019

    @DanTup
    Member

    It probably wouldn't hurt, but based on microsoft/vscode#71666 I suspect it'd be rejected as something for us to do in the extension once they add an API for us to add custom commands to the context menu there (where we could add a "Copy raw value" or similar).

  9. modified the milestones: Backlog, v3.10.0 on Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in debuggingRelates to the debug adapter or process of running debug sessionsis bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions