Skip to content

Commit

Permalink
Merge pull request #1047 from microsoft/dev/andris/cmake_tools/github…
Browse files Browse the repository at this point in the history
…_issue_1036

Fix GitHub issue 1036: debug command variables throw exception
  • Loading branch information
andreeis authored Feb 6, 2020
2 parents e371089 + 38541ba commit c7d8576
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,15 +223,18 @@ class ExtensionManager implements vscode.Disposable {
}

private _checkStringFolderArgs(folder?: vscode.WorkspaceFolder | string): vscode.WorkspaceFolder | undefined {
if (folder === undefined && vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length === 1) {
if (vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length === 1) {
// We don't want to break existing setup for single root projects.
return vscode.workspace.workspaceFolders[0];
}
if (util.isString(folder)) {
// Expected schema is file...
return vscode.workspace.getWorkspaceFolder(vscode.Uri.file(folder as string));
}
return folder as vscode.WorkspaceFolder;
if ((folder as vscode.WorkspaceFolder).uri) {
return folder;
}
return this._folders.activeFolder?.folder;
}

private async _pickFolder() {
Expand Down

0 comments on commit c7d8576

Please sign in to comment.