Skip to content

Commit 2284ba9

Browse files
committed
fix #753
1 parent 2df417a commit 2284ba9

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/client/workspaceSymbols/main.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ export class WorkspaceSymbols implements vscode.Disposable {
5959
if (!pythonSettings.workspaceSymbols.enabled || (token && token.isCancellationRequested)) {
6060
return Promise.resolve([]);
6161
}
62+
if (!vscode.workspace || typeof vscode.workspace.rootPath !== 'string' || vscode.workspace.rootPath.length === 0) {
63+
return Promise.resolve([]);
64+
}
6265
return fsExistsAsync(pythonSettings.workspaceSymbols.tagFilePath).then(exits => {
6366
let promise = Promise.resolve();
6467

src/client/workspaceSymbols/provider.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ export class WorkspaceSymbolProvider implements vscode.WorkspaceSymbolProvider {
1515
if (!pythonSettings.workspaceSymbols.enabled) {
1616
return [];
1717
}
18+
if (!vscode.workspace || typeof vscode.workspace.rootPath !== 'string' || vscode.workspace.rootPath.length === 0) {
19+
return Promise.resolve([]);
20+
}
1821
// check whether tag file needs to be built
1922
const tagFileExists = await fsExistsAsync(pythonSettings.workspaceSymbols.tagFilePath);
2023
if (!tagFileExists) {

0 commit comments

Comments
 (0)