explorer: use findClosesRoot in select()
This commit is contained in:
parent
3aca77c016
commit
5109a52b2a
1 changed files with 4 additions and 7 deletions
|
@ -227,16 +227,13 @@ export class ExplorerService implements IExplorerService {
|
|||
|
||||
// Stat needs to be resolved first and then revealed
|
||||
const options: IResolveFileOptions = { resolveTo: [resource], resolveMetadata: this.sortOrder === SortOrder.Modified };
|
||||
const workspaceFolder = this.contextService.getWorkspaceFolder(resource);
|
||||
if (workspaceFolder === null) {
|
||||
return Promise.resolve(undefined);
|
||||
const root = this.findClosestRoot(resource);
|
||||
if (!root) {
|
||||
return undefined;
|
||||
}
|
||||
const rootUri = workspaceFolder.uri;
|
||||
|
||||
const root = this.roots.find(r => this.uriIdentityService.extUri.isEqual(r.resource, rootUri))!;
|
||||
|
||||
try {
|
||||
const stat = await this.fileService.resolve(rootUri, options);
|
||||
const stat = await this.fileService.resolve(root.resource, options);
|
||||
|
||||
// Convert to model
|
||||
const modelStat = ExplorerItem.create(this.fileService, stat, undefined, options.resolveTo);
|
||||
|
|
Loading…
Reference in a new issue