Fix #79047 - Wasted stat call on workspace root #79052
Fix #79047 - Wasted stat call on workspace root #79052isidorn merged 2 commits intomicrosoft:masterfrom
Conversation
| const options: IResolveFileOptions = { resolveTo: [resource], resolveMetadata: this.sortOrder === 'modified' }; | ||
| const workspaceFolder = this.contextService.getWorkspaceFolder(resource); | ||
| const rootUri = workspaceFolder ? workspaceFolder.uri : this.roots[0].resource; | ||
|
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
@isidorn I agree. Have just updated my branch.
|
I have commented on your change directly. Once you address that we can merge this in. |
|
Looks great, merging in. |
This fix prevents a wasted stat call being made to a FileSystemProvider in specific circumstances. See #79047