Skip to content

Work around for VSC Bug - Fix Path Mappings to lowercase the drive letter #5362

Closed

Description

When using path mappings on windows, ensure the drive letter is lower cased.
I.e. when user uses the following setup, ${workspaceFolder} gets translated to a path with an upper case drive letter.

      "pathMappings": [
        {
          "localRoot": "${workspaceFolder}/modules/rfidreader/",
          "remoteRoot": "/app/"
        }
      ],

This is a work around for a VSC bug

Activity

  1. ghost added
    triage-neededNeeds assignment to the proper sub-team
    on Apr 18, 2019
  2. changed the title [-]Path Mappings[/-] [+]Fix Path Mappings to lowercase the drive letter[/+] on Apr 18, 2019
  3. ghost removed
    triage-neededNeeds assignment to the proper sub-team
    on Apr 18, 2019
  4. ghost removed
    triage-neededNeeds assignment to the proper sub-team
    on Apr 18, 2019
  5. ghost removed
    triage-neededNeeds assignment to the proper sub-team
    on Apr 18, 2019
  6. changed the title [-]Fix Path Mappings to lowercase the drive letter[/-] [+]Work around for VSC Bug - Fix Path Mappings to lowercase the drive letter[/+] on Apr 18, 2019
  7. DonJayamanne commented on Jun 12, 2019

    @DonJayamanne
    Author

    Prescribed Solution:

  8. karrtikr commented on Jun 18, 2019

    @karrtikr

    When the pathmappings is not an empty list, localRoot is not being lowercased.

  9. removed their assignment
    on Jun 18, 2019
  10. DonJayamanne commented on Jun 18, 2019

    @DonJayamanne
    Author

    Kim-Adeline Miguel (@kimadeline) I can see where this will fail.
    We're lower casing ONLY if pathMappings.length === 0.
    We need to change it and ensure all paths in path mappings are lower cased.

    Thanks Kartik Raj (@karrtikr)

  11. karrtikr commented on Jun 18, 2019

    @karrtikr

    Suggestion

    • Check src\client\debugger\extension\hooks\childProcessAttachService.ts -> fixPathMappings().
      Use similar logic to resolve localRoot
    const systemVariables = new SystemVariables(config.workspaceFolder);
    const localRoot = systemVariables.resolveAny(<localRootProvided>);
    
    • Then take the localRoot of path mappings and convert drive letter to lower case (on windows)
  12. DonJayamanne commented on Jun 18, 2019

    @DonJayamanne
    Author

    Kim-Adeline Miguel (@kimadeline) I agree with Kartik Raj (@karrtikr) His suggestion puts the changes in the right place.

  13. karrtikr commented on Jun 19, 2019

    @karrtikr

    validated

  14. locked as resolved and limited conversation to collaborators on Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-debuggingbugIssue identified by VS Code Team member as probable buggood first issueimportantIssue identified as high-priority

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions