Skip to content

Commit

Permalink
add rendering for document symbol detail, #34968
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Jun 13, 2018
1 parent fc9dab9 commit f7bdfb5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
16 changes: 16 additions & 0 deletions src/vs/workbench/parts/outline/electron-browser/outlinePanel.css
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,22 @@
font-weight: bold;
}

.monaco-workbench .outline-panel .outline-element .outline-element-detail {
visibility: hidden;
flex: 1;
flex-basis: 10%;
opacity: 0.8;
overflow: hidden;
text-overflow: ellipsis;
font-size: 90%;
padding-left: 4px;
padding-top: 3px;
}

.monaco-workbench .outline-panel .monaco-tree-row.focused .outline-element .outline-element-detail {
visibility: inherit;
}

.monaco-workbench .outline-panel .outline-element .outline-element-decoration {
opacity: 0.75;
font-size: 90%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export interface OutlineTemplate {
labelContainer: HTMLElement;
label: HighlightedLabel;
icon?: HTMLElement;
detail?: HTMLElement;
decoration?: HTMLElement;
}

Expand Down Expand Up @@ -147,10 +148,11 @@ export class OutlineRenderer implements IRenderer {
if (templateId === 'outline-element') {
const icon = dom.$('.outline-element-icon symbol-icon');
const labelContainer = dom.$('.outline-element-label');
const detail = dom.$('.outline-element-detail');
const decoration = dom.$('.outline-element-decoration');
dom.addClass(container, 'outline-element');
dom.append(container, icon, labelContainer, decoration);
return { icon, labelContainer, label: new HighlightedLabel(labelContainer), decoration };
dom.append(container, icon, labelContainer, detail, decoration);
return { icon, labelContainer, label: new HighlightedLabel(labelContainer), detail, decoration };
}
if (templateId === 'outline-group') {
const labelContainer = dom.$('.outline-element-label');
Expand All @@ -166,6 +168,7 @@ export class OutlineRenderer implements IRenderer {
if (element instanceof OutlineElement) {
template.icon.className = `outline-element-icon symbol-icon ${symbolKindToCssClass(element.symbol.kind)}`;
template.label.set(element.symbol.name, element.score ? createMatches(element.score[1]) : undefined);
template.detail.innerText = element.symbol.detail || '';
this._renderMarkerInfo(element, template);

}
Expand Down

0 comments on commit f7bdfb5

Please sign in to comment.