Repository navigation
#85858 Allow breadcrumbs.symbolSortOrder per language - #86430
Conversation
| } | ||
|
|
||
| protected _createTree(container: HTMLElement) { | ||
| protected _createTree(container: HTMLElement, element: BreadcrumbElement) { |
There was a problem hiding this comment.
Not so nice - given that there is _setInput. Why not update/modify the filter in there
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
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
There was a problem hiding this comment.
I see what you mean, like this?
Johannes Rieken (jrieken)
left a comment
There was a problem hiding this comment.
looking good. thanks
This PR fixes #85858
Johannes Rieken (@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: