Skip to content

Commit 7d90a94

Browse files
committed
fix empty workspace bug
1 parent 2eae6aa commit 7d90a94

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/jsImport.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ export default class JsImport {
1313
public static rootCaches = {};
1414

1515
public run(context: vscode.ExtensionContext) {
16-
vscode.workspace.workspaceFolders.map(item => {
17-
const cache = new RootCache(item);
18-
JsImport.rootCaches[item.uri.fsPath] = cache;
19-
})
16+
if (vscode.workspace.workspaceFolders) {
17+
vscode.workspace.workspaceFolders.map(item => {
18+
const cache = new RootCache(item);
19+
JsImport.rootCaches[item.uri.fsPath] = cache;
20+
})
21+
}
2022

2123
this.attachCommands(context);
2224

vscode-js-import-0.15.0.vsix

13 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)