Skip to content

Represent lables without normalisation in workbench #29985

Closed

Description

@hbenl
  • VSCode Version: 1.13.1
  • OS Version: Windows 7

This has been originally reported here

Steps to Reproduce:

  1. start a debugging session using the Chrome or Firefox debug adapter (those are the ones I checked)
  2. step into a remote source that can't be mapped to a local path by the debug adapter
  3. have a look at the tooltip shown for the remote source - it will display e.g. http:\test.com\file.html instead of the correct http://test.com/file.html

When the debug adapter wants to send a Source object for a remote file to VS Code, it can do so by setting the path to the URL of the remote file and adding a sourceReference which can be used by VS Code to retrieve the file content from the debug adapter.
This is working fine, except that on Windows the URL is slightly garbled when it's presented to the user in the tooltip - VS Code seems to insist on interpreting the path property as a local file path (which is why / is replaced with \ on Windows), but in this case it's not.
I think VS Code should not modify the path property if the sourceReference property is set, because this signals that the Source object does not correspond to a local file but something else (a remote file or a script passed to eval(), for example).

Activity

  1. added
    debug
    on Jul 1, 2017
  2. isidorn commented on Jul 3, 2017

    @isidorn

    This is simply how worbkench is presetning files always
    So we would need an option to not normalize labels in workbench -> feature request

    fyi Benjamin Pasero (@bpasero)

  3. added
    feature-request
    and removed
    debug
    on Jul 3, 2017
  4. changed the title [-]Debugger interprets URLs of remote sources as local paths [/-] [+]Represent lables without normalisation in workbench[/+] on Jul 3, 2017
  5. bpasero commented on Jul 3, 2017

    @bpasero
    Contributor

    Isidor Nikolic (@isidorn) can you point me to the code where you set the label? I wonder if we should maybe be smarter when the resource is not a file resource.

  6. bpasero commented on Jul 3, 2017

    @bpasero
    Contributor

    Yeah we typically always call URI.fsPath and then show this in a label. fsPath will convert slashes to backslash. This needs some better story for how to represent non file resources in the UI. It is probably already wrong that we call dirname on these editor description labels.

    Isidor Nikolic (@isidorn) you can pass over a label and description to use for editors so maybe it would be good for you to handle this better? The fsPath and dirname is really just a fallback when the caller of openEditor is not providing any better labels.

  7. hbenl commented on Oct 15, 2017

    @hbenl
    Author

    I just noticed that this is fixed in VS Code 1.17.1

  8. isidorn commented on Oct 16, 2017

    @isidorn

    Holger Benl (@hbenl) thanks for checking. Yes we have been doing some remote file system work which probably touched on this

  9. added
    debug
    on Oct 25, 2017
  10. locked and limited conversation to collaborators on Nov 29, 2017
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

    debugfeature-request

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions