File tree Expand file tree Collapse file tree
src/client/workspaceSymbols Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 ) {
You can’t perform that action at this time.
0 commit comments