提交 8602d6d7 编写于 作者: J Joao Moreno

Merge branch 'master' into isidorn/debugTrees

......@@ -27,7 +27,7 @@ enum AsyncDataTreeNodeState {
}
interface IAsyncDataTreeNode<T extends NonNullable<any>> {
readonly element: T | null;
element: T | null;
readonly parent: IAsyncDataTreeNode<T> | null;
readonly id?: string | null;
readonly children?: IAsyncDataTreeNode<T>[];
......@@ -263,7 +263,7 @@ export class AsyncDataTree<T extends NonNullable<any>, TFilterData = void> imple
// Data Tree
refresh(element: T | null, recursive = false): Thenable<void> {
refresh(element: T | null, recursive = true): Thenable<void> {
return this.refreshNode(this.getDataNode(element), recursive, ChildrenResolutionReason.Refresh);
}
......@@ -409,7 +409,15 @@ export class AsyncDataTree<T extends NonNullable<any>, TFilterData = void> imple
return node;
}
private refreshNode(node: IAsyncDataTreeNode<T>, recursive: boolean, reason: ChildrenResolutionReason): Thenable<void> {
private async refreshNode(node: IAsyncDataTreeNode<T>, recursive: boolean, reason: ChildrenResolutionReason): Promise<void> {
await this._refreshNode(node, recursive, reason);
if (recursive && node.children) {
await Promise.all(node.children.map(child => this.refreshNode(child, recursive, reason)));
}
}
private _refreshNode(node: IAsyncDataTreeNode<T>, recursive: boolean, reason: ChildrenResolutionReason): Thenable<void> {
let result = this.refreshPromises.get(node);
if (result) {
......@@ -427,6 +435,8 @@ export class AsyncDataTree<T extends NonNullable<any>, TFilterData = void> imple
if (!hasChildren) {
this.setChildren(node, [], recursive);
return Promise.resolve();
} else if (node !== this.root && this.tree.isCollapsed(node)) {
return Promise.resolve();
} else {
node.state = AsyncDataTreeNodeState.Loading;
this._onDidChangeNodeState.fire(node);
......@@ -503,19 +513,20 @@ export class AsyncDataTree<T extends NonNullable<any>, TFilterData = void> imple
};
}
// TODO
// if (recursive) {
// asyncDataTreeNode.state = AsyncDataTreeNodeState.Uninitialized;
asyncDataTreeNode.element = element;
if (recursive) {
asyncDataTreeNode.state = AsyncDataTreeNodeState.Uninitialized;
// if (this.tree.isCollapsed(asyncDataTreeNode)) {
// asyncDataTreeNode.children!.length = 0;
if (this.tree.isCollapsed(asyncDataTreeNode)) {
asyncDataTreeNode.children!.length = 0;
// return {
// element: asyncDataTreeNode,
// collapsible: this.dataSource.hasChildren(element),
// };
// }
// }
return {
element: asyncDataTreeNode,
collapsible: this.dataSource.hasChildren(element),
};
}
}
return {
element: asyncDataTreeNode,
......
......@@ -36,6 +36,10 @@
height: 100%;
}
.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .selected .reference-file {
color: inherit !important;
}
.monaco-editor .reference-zone-widget .ref-tree .reference-file .count {
margin-right: 12px;
margin-left: auto;
......
......@@ -35,7 +35,7 @@ import { IMouseEvent } from 'vs/base/browser/mouseEvent';
import { localize } from 'vs/nls';
import { timeout } from 'vs/base/common/async';
import { CollapseAllAction } from 'vs/base/parts/tree/browser/treeDefaults';
import { editorFindMatchHighlight, editorFindMatchHighlightBorder } from 'vs/platform/theme/common/colorRegistry';
import { editorFindMatchHighlight, editorFindMatchHighlightBorder, textLinkForeground, textCodeBlockBackground } from 'vs/platform/theme/common/colorRegistry';
import { IMarkdownString } from 'vs/base/common/htmlContent';
import { isString } from 'vs/base/common/types';
import { renderMarkdown, RenderOptions } from 'vs/base/browser/htmlContentRenderer';
......@@ -583,6 +583,14 @@ registerThemingParticipant((theme, collector) => {
if (findMatchHighlightColorBorder) {
collector.addRule(`.file-icon-themable-tree .monaco-tree-row .content .monaco-highlighted-label .highlight { color: unset !important; border: 1px dotted ${findMatchHighlightColorBorder}; box-sizing: border-box; }`);
}
const link = theme.getColor(textLinkForeground);
if (link) {
collector.addRule(`.tree-explorer-viewlet-tree-view > .message a { color: ${link}; }`);
}
const codeBackground = theme.getColor(textCodeBlockBackground);
if (codeBackground) {
collector.addRule(`.tree-explorer-viewlet-tree-view > .message code { background-color: ${codeBackground}; }`);
}
});
class TreeRenderer implements IRenderer {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册