Skip to content

Conversation

@rkeithhill
Copy link
Contributor

Turns out vscode passes us the cwd. Just needed to rename the property in the LaunchRequest class to match. Same for args (renamed Arguments). I have not hooked up script args yet though.

@daviwil - please look over the ExecuteCommand for Set-Location to make sure I'm doing the ContinueWith() correctly.

…ble. Turns out vscode passes us the cwd. Just needed to rename the property in the LaunchRequest class to match. Same for args (renamed Arguments). I have not hooked up script args yet though.
@rkeithhill
Copy link
Contributor Author

BTW if this goes through I will be updating the package.json to add configurationProperties for cwd and maybe args (if I can figure out how to pass those args to the script reliably) e.g.:

"configurationAttributes": { "launch": { "required": [ "program" ], "properties": { "program": { "type": "string", "description": "Workspace relative path to the PowerShell script." }, "args": { "type": "array", "description": "Command line arguments passed to the PowerShell script", "items": { "type": "string" }, "default": [] }, "cwd": { "type": "string", "description": "Workspace relative or absolute path for the working directory. Default is the current workspace.", "default": "." } } } }, "initialConfigurations": [ { "name": "PowerShell", "type": "PowerShell", "request": "launch", "program": "${file}", "args": [], "cwd": "${workspaceRoot}" } ]
@daviwil
Copy link
Contributor

daviwil commented Feb 7, 2016

Awesome! I think you can simplify your code a little bit, will leave a comment in the commit


// /** Launch the debuggee in this working directory (specified as an absolute path). If omitted the debuggee is lauched in its own directory. */
public string WorkingDirectory { get; set; }
public string Cwd { get; set; }
Copy link
Contributor

Choose a reason for hiding this comment

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

Apparently they changed this on me a long time ago and I never noticed it...

Also found two launch params that have been renamed (looking at 0.10.7-insiders mono-debug package.json file). Although I don't think runtimeArgs really applies to PowerShell debugging. The "runtimeExecutable" is the debug host and by the time the launch message comes along, it is already started.
@rkeithhill
Copy link
Contributor Author

OK, updated that method as you suggested.

daviwil added a commit that referenced this pull request Feb 7, 2016
Fixes #137 - working dir should be set to something reasonable.
@daviwil daviwil merged commit 83aed94 into PowerShell:master Feb 7, 2016
@daviwil
Copy link
Contributor

daviwil commented Feb 7, 2016

Fantastic, thanks! Merged it.

@rkeithhill rkeithhill deleted the rkeithhill/is137-dbg-working-dir branch February 7, 2016 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants