Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Enable path mappings for remote debugging #308

Merged
merged 10 commits into from
Apr 4, 2018

Conversation

DonJayamanne
Copy link
Contributor

@DonJayamanne DonJayamanne commented Apr 4, 2018

Fixes #241
Unfortunately I've had to modify a PyDev (If someone can think of a way around this I'm all ears).
The problem is when we initialize the path mappings, the attribute norm_file_to_client points to a different function, however its too late as pydev has already imported it using from import

@codecov-io
Copy link

codecov-io commented Apr 4, 2018

Codecov Report

Merging #308 into master will increase coverage by 1.28%.
The diff coverage is 62.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #308      +/-   ##
==========================================
+ Coverage   62.66%   63.95%   +1.28%     
==========================================
  Files          11       14       +3     
  Lines        1875     2000     +125     
==========================================
+ Hits         1175     1279     +104     
- Misses        700      721      +21
Impacted Files Coverage Δ
ptvsd/wrapper.py 50.52% <62.5%> (+0.22%) ⬆️
ptvsd/pydevd_hooks.py 61.29% <0%> (ø)
ptvsd/socket.py 90.32% <0%> (ø)
ptvsd/daemon.py 67.22% <0%> (ø)
ptvsd/ipcjson.py 66.82% <0%> (+1.46%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9be9db4...c001683. Read the comment docs.

@karthiknadig
Copy link
Member

This should work for VS as well. No need to be VSC specific. @int19h Do you think VS will need something different?

ptvsd/wrapper.py Outdated
@@ -930,10 +931,22 @@ def _parse_debug_options(self, debug_options):
options[key] = DEBUG_OPTIONS_PARSER[key](value)
return options

def _initialize_vsc_path_maps(self, args):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets make this generic, since this will work for VS as well.

ptvsd/wrapper.py Outdated
@@ -930,10 +931,22 @@ def _parse_debug_options(self, debug_options):
options[key] = DEBUG_OPTIONS_PARSER[key](value)
return options

def _initialize_vsc_path_maps(self, args):
pathMaps = []
for pathMapping in args.get('pathMappings', []):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have a readme.md describing these custom message items for clarity.

@DonJayamanne
Copy link
Contributor Author

@karthiknadig Please review the updates to the readme.md
@int19h Please review the names (pathMappings passed in. I'd like to ensure both VS and VSC use the same message format where possible. Hence the names are important in this case).

@DonJayamanne DonJayamanne requested a review from int19h April 4, 2018 18:09
@int19h
Copy link
Contributor

int19h commented Apr 4, 2018

One general catch wrt this PR is that any change to pydevd stuff has to be in its own separate commit (so that we can easily upstream the subtree).

@DonJayamanne
Copy link
Contributor Author

One general catch wrt this PR is that any change to pydevd stuff has to be in its own separate commit (so that we can easily upstream the subtree).

Aah yes, forgot about that. Will Fix that.

@DonJayamanne
Copy link
Contributor Author

@int19h
Fixed

@DonJayamanne
Copy link
Contributor Author

@int19h
Created a new PR #310

@int19h
Copy link
Contributor

int19h commented Apr 4, 2018

Can you rebase and squish it to make sure that all commits are separate? I'm not sure if subtree merge is going to complain about a reverted commit... but if it applies them one by one, it probably will.

@DonJayamanne
Copy link
Contributor Author

DonJayamanne commented Apr 4, 2018

@int19h
Wouldn't squash and merge solve the problem. (that's the default Merge Operation i choose)?
All merges will be collapsed into 1 commit.

@int19h
Copy link
Contributor

int19h commented Apr 4, 2018

It should, I just wanted to make sure that's what actually happens (since it'll commit immediately after). But I guess we can always remove those commits if it goes wrong.

@DonJayamanne DonJayamanne merged commit 44d18a0 into microsoft:master Apr 4, 2018
@DonJayamanne DonJayamanne deleted the issue241VSCPathMapping branch July 14, 2018 22:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants