提交 fa8c6e6b 编写于 作者: G gjsjohnmurray

Improve #79047 fix after feedback

上级 1364caff
...@@ -158,12 +158,10 @@ export class ExplorerService implements IExplorerService { ...@@ -158,12 +158,10 @@ export class ExplorerService implements IExplorerService {
// Stat needs to be resolved first and then revealed // Stat needs to be resolved first and then revealed
const options: IResolveFileOptions = { resolveTo: [resource], resolveMetadata: this.sortOrder === 'modified' }; const options: IResolveFileOptions = { resolveTo: [resource], resolveMetadata: this.sortOrder === 'modified' };
const workspaceFolder = this.contextService.getWorkspaceFolder(resource); const workspaceFolder = this.contextService.getWorkspaceFolder(resource);
const rootUri = workspaceFolder ? workspaceFolder.uri : this.roots[0].resource; if (workspaceFolder === null) {
// Do not waste time looking in a different scheme
if (resource.scheme !== rootUri.scheme) {
return Promise.resolve(undefined); return Promise.resolve(undefined);
} }
const rootUri = workspaceFolder.uri;
const root = this.roots.filter(r => r.resource.toString() === rootUri.toString()).pop()!; const root = this.roots.filter(r => r.resource.toString() === rootUri.toString()).pop()!;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册