-
Notifications
You must be signed in to change notification settings - Fork 37.6k
Fix #124276 batch markdown file requests #124545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
extensions/markdown-language-features/src/features/workspaceSymbolProvider.ts
Outdated
Show resolved
Hide resolved
extensions/markdown-language-features/src/features/workspaceSymbolProvider.ts
Outdated
Show resolved
Hide resolved
|
|
||
| this._watcher.onDidChange(async resource => { | ||
| const document = await this.getMarkdownDocument(resource); | ||
| if (document) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please make these changes in a separate PR? I'd like to keep this one scoped to just batching the requests
nrayburn-tech
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mjbvz updated.
| return docs.filter(doc => !!doc) as SkinnyTextDocument[]; | ||
|
|
||
| // add 1 in case of any remaining files, | ||
| // ex (10 % 3) = 3, needs 1 more loop to complete |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this comment necessary?
| const resourceBatch = resources.slice(i * maxConcurrent, (i + 1) * maxConcurrent); | ||
| (await Promise.all(resourceBatch.map(async doc => { | ||
| return await this.getMarkdownDocument(doc); | ||
| }))).filter((doc) => !!doc); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be broken up for readability?
james7618891
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Visa
extensions/markdown-language-features/src/features/workspaceSymbolProvider.ts
Show resolved
Hide resolved
extensions/markdown-language-features/src/features/workspaceSymbolProvider.ts
Outdated
Show resolved
Hide resolved
extensions/markdown-language-features/src/features/workspaceSymbolProvider.ts
Outdated
Show resolved
Hide resolved
cleanup function call remove modulo use
|
@mjbvz should all be resolved now. |
mjbvz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very small change but otherwise looks good for merging
extensions/markdown-language-features/src/features/workspaceSymbolProvider.ts
Outdated
Show resolved
Hide resolved
|
@mjbvz updated with the change and merged upstream. |
|
Thanks! This is schooled to go out with VS Code 1.60 at the end of this month |
| undefined. This doesn't seem like a valid return type for that function and allowed some ifs to be removed, and a filter on the batching requests function.I would expect using batches to reduce performance on workspaces that have a large number of
.mdfiles. I don't have a good way to test this for comparison though.This PR fixes #124276.