-
Notifications
You must be signed in to change notification settings - Fork 520
Commit 63bbb2f
authored
Support debugging without a workspace (#3728)
The existing code assumed there was always at least one workspace
folder, but this led to an error if there were zero. This can be
reproduced by calling "Close Workspace" if one is open and then running
Pester tests. Since the `vscode.debug.startDebugging()` interface does
not require a workspace folder, and in fact expects "undefined" if none
is available, we simply use TypeScript's "optional chaining" (AKA
conditional access) operator to return undefined if `workspaceFolders`
is null, and otherwise return the first workspace folder.1 parent 9340fd9 commit 63bbb2f
2 files changed
+2
-2
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
144 | 144 |
| |
145 | 145 |
| |
146 | 146 |
| |
147 | - | ||
147 | + | ||
148 | 148 |
| |
149 | 149 |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
49 | 49 |
| |
50 | 50 |
| |
51 | 51 |
| |
52 | - | ||
52 | + | ||
53 | 53 |
| |
54 | 54 |
| |
55 | 55 |
| |
|
0 commit comments