-
Notifications
You must be signed in to change notification settings - Fork 260
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
Add support for maxItemsComputed #444
Conversation
e52fd7e
to
ba4c727
Compare
|
||
return result.slice(0, context.rangeLimit - 1); | ||
return result.slice(0, context.rangeLimit); |
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.
I believe this was an off-by-one error that I've now added a test for.
@@ -169,7 +185,17 @@ export class LanguageHandlers { | |||
return; | |||
} | |||
|
|||
return this.languageService.getFoldingRanges(textDocument, this.yamlSettings.capabilities.textDocument.foldingRange); | |||
const capabilities = this.yamlSettings.capabilities.textDocument.foldingRange; |
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.
There weren't any existing tests for foldingRangeHandler
so I didn't add any to test this new functionality (just the underlying getFoldingRanges
).
@@ -275,5 +301,21 @@ describe('Document Symbols Tests', () => { | |||
createExpectedDocumentSymbol('conditions', SymbolKind.Module, 6, 12, 10, 28, 6, 12, 6, 22, [root2]) | |||
); | |||
}); | |||
|
|||
it('Document symbols with a limit', () => { |
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.
Why does this test and the one above on line 141 have the same description?
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.
Ah, sorry, I relied on the different describe
blocks to differentiate them but I see this doesn't match the naming convention in the file. Will fix.
(misread the test file in my initial response)
These are for the hierarchical and non-hierarchical cases inside separate describe blocks.
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.
OK, thanks. I missed that in the truncated github diff view.
What does this PR do?
Adds support for a
yaml.maxItemsComputed
setting that mirrorsjson.maxItemsComputed
from the built-in JSON language service. It caps the number of outline symbols and folding regions computed for performance reasons.Companion PR: redhat-developer/vscode-yaml#486
What issues does this PR fix or reference?
redhat-developer/vscode-yaml#485
Is it tested? How?
Wrote automated tests.
Confirmed this fixes the bug:
Confirmed settings update as expected: