#85858 Allow breadcrumbs.symbolSortOrder per language#86430
Merged
jrieken merged 2 commits intomicrosoft:masterfrom Dec 9, 2019
jzyrobert:85858-breadcrumbs
Merged
#85858 Allow breadcrumbs.symbolSortOrder per language#86430jrieken merged 2 commits intomicrosoft:masterfrom jzyrobert:85858-breadcrumbs
jrieken merged 2 commits intomicrosoft:masterfrom
jzyrobert:85858-breadcrumbs
Conversation
jrieken
requested changes
Dec 6, 2019
| } | ||
|
|
||
| protected _createTree(container: HTMLElement) { | ||
| protected _createTree(container: HTMLElement, element: BreadcrumbElement) { |
Member
There was a problem hiding this comment.
Not so nice - given that there is _setInput. Why not update/modify the filter in there
Contributor
Author
There was a problem hiding this comment.
I don't think that works.
I tried:
protected _setInput(input: BreadcrumbElement): Promise<void> {
const element = input as TreeElement;
const model = OutlineModel.get(element)!;
const textModel = model.textModel;
this._overrideConfiguration = {
resource: textModel.uri,
overrideIdentifier: textModel.getLanguageIdentifier().language
};
and
private _getOutlineItemCompareType(): OutlineSortOrder {
switch (this._symbolSortOrder.getValue(this._overrideConfiguration)) {
However in testing, _getOutlineItemCompareType gets called before _setInput, making the override undefined.
This makes sense as _createTree is called before _setInput, and OutlineComparator only takes a value rather than a function, so you have to have the override ready at the time of _createTree
Member
There was a problem hiding this comment.
Just store the sorter in a property when _createTree is called and update it when _setInput is called
Contributor
Author
There was a problem hiding this comment.
I see what you mean, like this?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes #85858
@jrieken Is this fine? I looked at how the other function uses
OutlineModel, and it seems like it needs the input element, so I modified the function signature.Example:



Javascript file without override uses default order:
Typescript files use the overriden name order: