Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/1 Enhancements/1385.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add localRoot and remoteRoot defaults for Remote Debugging configuration in `launch.json`.
12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -675,14 +675,20 @@
}
},
{
"label": "Python: Attach",
"label": "Python: Remote Attach",
"description": "%python.snippet.launch.attach.description%",
"body": {
"name": "Attach (Remote Debug)",
"type": "python",
"request": "attach",
"port": 5678,
"host": "localhost"
"host": "localhost",
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "."
}
]
}
}
],
Expand Down Expand Up @@ -1996,4 +2002,4 @@
"publisherDisplayName": "Microsoft",
"publisherId": "998b010b-e2af-44a5-a6cd-0b5fd3b9b6f8"
}
}
}
12 changes: 9 additions & 3 deletions resources/default.launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@
"console": "integratedTerminal"
},
{
"name": "Python: Attach",
"name": "Python: Remote Attach",
"type": "python",
"request": "attach",
"port": 5678,
"host": "localhost"
"host": "localhost",
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "."
}
]
},
{
"name": "Python: Module",
Expand Down Expand Up @@ -55,4 +61,4 @@
"program": "${file}",
"console": "externalTerminal"
}
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,18 @@ const defaultPort = 5678;
export class RemoteAttachDebugConfigurationProvider implements IDebugConfigurationProvider {
public async buildConfiguration(input: MultiStepInput<DebugConfigurationState>, state: DebugConfigurationState): Promise<InputStep<DebugConfigurationState> | void> {
const config: Partial<AttachRequestArguments> = {
name: localize('python.snippet.launch.attach.label', 'Python: Attach')(),
name: localize('python.snippet.launch.attach.label', 'Python: Remote Attach')(),
type: DebuggerTypeName,
request: 'attach',
port: defaultPort,
host: defaultHost
host: defaultHost,
pathMappings: [
{
// tslint:disable-next-line:no-invalid-template-strings
localRoot: '${workspaceFolder}',
remoteRoot: '.'
}
]
};

config.host = await input.showInputBox({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,13 @@ suite('Debugging - Configuration Provider Remote Attach', () => {
type: DebuggerTypeName,
request: 'attach',
port: 5678,
host: 'localhost'
host: 'localhost',
pathMappings: [
{
localRoot: '${workspaceFolder}',
remoteRoot: '.'
}
]
};

expect(state.config).to.be.deep.equal(config);
Expand All @@ -110,7 +116,13 @@ suite('Debugging - Configuration Provider Remote Attach', () => {
type: DebuggerTypeName,
request: 'attach',
port: 9999,
host: 'Hello'
host: 'Hello',
pathMappings: [
{
localRoot: '${workspaceFolder}',
remoteRoot: '.'
}
]
};

expect(state.config).to.be.deep.equal(config);
Expand Down