Skip to content

Commit 26c5920

Browse files
jdneotestforstephen
authored andcommitted
Open in current window when no workspace folder is available (#204)
* fix: Open in current window when no workspace folder is available * Use boolean variable openInNewWindow to determine the openning target
1 parent 9382344 commit 26c5920

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/controllers/projectController.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the MIT license.
33

44
import * as fse from "fs-extra";
5+
import * as _ from "lodash";
56
import * as path from "path";
67
import { commands, ExtensionContext, Uri, window, workspace } from "vscode";
78
import * as xml2js from "xml2js";
@@ -43,7 +44,8 @@ export class ProjectController {
4344
return;
4445
}
4546
if (await this.scaffoldJavaProject(basePath, projectName, javaVersion)) {
46-
return commands.executeCommand("vscode.openFolder", Uri.file(path.join(basePath, projectName)), true);
47+
const openInNewWindow = workspace && !_.isEmpty(workspace.workspaceFolders);
48+
return commands.executeCommand("vscode.openFolder", Uri.file(path.join(basePath, projectName)), openInNewWindow);
4749
}
4850
}
4951

0 commit comments

Comments
 (0)