This commit is contained in:
parent
2376bed71e
commit
a4f9e60761
4 changed files with 7 additions and 6 deletions
|
@ -143,7 +143,7 @@ class DocumentSymbolsOutline implements IOutline<DocumentSymbolItem> {
|
|||
this._breadcrumbsDataSource = new DocumentSymbolBreadcrumbsSource(_editor, textResourceConfigurationService);
|
||||
const delegate = new DocumentSymbolVirtualDelegate();
|
||||
const renderers = [new DocumentSymbolGroupRenderer(), instantiationService.createInstance(DocumentSymbolRenderer, true)];
|
||||
const treeDataSource: IDataSource<this, DocumentSymbolItem> = {
|
||||
const treeDataSource: IDataSource<this | undefined, DocumentSymbolItem> = {
|
||||
getChildren: (parent) => {
|
||||
if (parent instanceof OutlineElement || parent instanceof OutlineGroup) {
|
||||
return parent.children.values();
|
||||
|
|
|
@ -325,7 +325,7 @@ class NotebookCellOutline implements IOutline<OutlineEntry> {
|
|||
keyboardNavigationLabelProvider: new NotebookNavigationLabelProvider()
|
||||
};
|
||||
|
||||
const treeDataSource: IDataSource<this, OutlineEntry> = { getChildren: parent => parent instanceof NotebookCellOutline ? this._entries : parent.children };
|
||||
const treeDataSource: IDataSource<this | undefined, OutlineEntry> = { getChildren: parent => parent instanceof NotebookCellOutline ? this._entries : parent?.children ?? [] };
|
||||
const delegate = new NotebookOutlineVirtualDelegate();
|
||||
const renderers = [instantiationService.createInstance(NotebookOutlineRenderer)];
|
||||
const comparator = new NotebookComparator();
|
||||
|
|
|
@ -74,7 +74,7 @@ export class OutlinePane extends ViewPane {
|
|||
private _message!: HTMLDivElement;
|
||||
private _progressBar!: ProgressBar;
|
||||
private _treeContainer!: HTMLElement;
|
||||
private _tree?: WorkbenchDataTree<IOutline<any>, any, FuzzyScore>;
|
||||
private _tree?: WorkbenchDataTree<IOutline<any> | undefined, any, FuzzyScore>;
|
||||
private _treeDimensions?: dom.Dimension;
|
||||
private _treeStates = new LRUCache<string, IDataTreeViewState>(10);
|
||||
|
||||
|
@ -215,7 +215,7 @@ export class OutlinePane extends ViewPane {
|
|||
|
||||
const sorter = new OutlineTreeSorter(newOutline.treeConfig.comparator, this._outlineViewState.sortBy);
|
||||
|
||||
const tree = <WorkbenchDataTree<IOutline<any>, any, FuzzyScore>>this._instantiationService.createInstance(
|
||||
const tree = <WorkbenchDataTree<IOutline<any> | undefined, any, FuzzyScore>>this._instantiationService.createInstance(
|
||||
WorkbenchDataTree,
|
||||
'OutlinePane',
|
||||
this._treeContainer,
|
||||
|
@ -239,6 +239,7 @@ export class OutlinePane extends ViewPane {
|
|||
if (newOutline.isEmpty) {
|
||||
// no more elements
|
||||
this._showMessage(localize('no-symbols', "No symbols found in document '{0}'", basename(resource)));
|
||||
tree.setInput(undefined);
|
||||
|
||||
} else if (!tree.getInput()) {
|
||||
// first: init tree
|
||||
|
|
|
@ -41,7 +41,7 @@ export interface IOutlineComparator<E> {
|
|||
|
||||
export interface IOutlineBreadcrumbsConfig<E> {
|
||||
readonly breadcrumbsDataSource: IBreadcrumbsDataSource<E>;
|
||||
readonly treeDataSource: IDataSource<IOutline<E>, E>;
|
||||
readonly treeDataSource: IDataSource<IOutline<E> | undefined, E>;
|
||||
readonly delegate: IListVirtualDelegate<E>;
|
||||
readonly renderers: ITreeRenderer<E, FuzzyScore, any>[];
|
||||
readonly comparator: IOutlineComparator<E>;
|
||||
|
@ -49,7 +49,7 @@ export interface IOutlineBreadcrumbsConfig<E> {
|
|||
}
|
||||
|
||||
export interface IOutlineTreeConfig<E> {
|
||||
readonly treeDataSource: IDataSource<IOutline<E>, E>;
|
||||
readonly treeDataSource: IDataSource<IOutline<E> | undefined, E>;
|
||||
readonly delegate: IListVirtualDelegate<E>;
|
||||
readonly renderers: ITreeRenderer<E, FuzzyScore, any>[];
|
||||
readonly comparator: IOutlineComparator<E>;
|
||||
|
|
Loading…
Reference in a new issue