Skip to content

Conversation

gjsjohnmurray
Copy link
Contributor

This fix prevents a wasted stat call being made to a FileSystemProvider in specific circumstances. See #79047

@isidorn isidorn self-assigned this Aug 13, 2019
@isidorn isidorn added this to the August 2019 milestone Aug 13, 2019
@@ -159,6 +159,12 @@ export class ExplorerService implements IExplorerService {
const options: IResolveFileOptions = { resolveTo: [resource], resolveMetadata: this.sortOrder === 'modified' };
const workspaceFolder = this.contextService.getWorkspaceFolder(resource);
const rootUri = workspaceFolder ? workspaceFolder.uri : this.roots[0].resource;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your check makes sense but I think we can make this more general.
I do not like the statment on line 161 that if the workspaceFolder does not exist we take the first root.

Let's change that, suche that if the workspaceFolder is not found the rootUri is undefined.
And if it is undefined we should just return.

I think this should also handle your use case. Let me know what you think about this and how ti goes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@isidorn I agree. Have just updated my branch.

@isidorn
Copy link
Collaborator

isidorn commented Aug 14, 2019

I have commented on your change directly. Once you address that we can merge this in.
The reason why I wouldp refer that approach is that if the resource does not belong to any root than a select is simply a no-op.

@isidorn
Copy link
Collaborator

isidorn commented Aug 14, 2019

Looks great, merging in.
Thanks a lot!

@isidorn isidorn merged commit 9465c78 into microsoft:master Aug 14, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
@gjsjohnmurray gjsjohnmurray deleted the fix-79047 branch July 6, 2020 15:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants