Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
DonJayamanne opened this issue Apr 18, 2019 · 6 comments
Closed
Assignees
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug good first issue important Issue identified as high-priority

Comments

@DonJayamanne
Copy link

DonJayamanne commented Apr 18, 2019

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

@ghost ghost added the triage-needed Needs assignment to the proper sub-team label Apr 18, 2019
@DonJayamanne DonJayamanne changed the title Path Mappings Fix Path Mappings to lowercase the drive letter Apr 18, 2019
@DonJayamanne DonJayamanne added area-debugging needs PR bug Issue identified by VS Code Team member as probable bug labels Apr 18, 2019
@ghost ghost removed triage-needed Needs assignment to the proper sub-team labels Apr 18, 2019
@DonJayamanne DonJayamanne added triage-needed Needs assignment to the proper sub-team important Issue identified as high-priority labels Apr 18, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Apr 18, 2019
@DonJayamanne DonJayamanne changed the title Fix Path Mappings to lowercase the drive letter Work around for VSC Bug - Fix Path Mappings to lowercase the drive letter Apr 18, 2019
@DonJayamanne
Copy link
Author

Prescribed Solution:

@karrtikr
Copy link

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

@karrtikr karrtikr removed their assignment Jun 18, 2019
@DonJayamanne
Copy link
Author

@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 @karrtikr

@karrtikr
Copy link

karrtikr commented Jun 18, 2019

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)

@DonJayamanne
Copy link
Author

@kimadeline I agree with @karrtikr His suggestion puts the changes in the right place.

@karrtikr
Copy link

validated

@ghost ghost removed the needs PR label Jun 19, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-debugging bug Issue identified by VS Code Team member as probable bug good first issue important Issue identified as high-priority
Projects
None yet
Development

No branches or pull requests

3 participants