Skip to content

Commit

Permalink
Use label as tooltip fallback properly
Browse files Browse the repository at this point in the history
  • Loading branch information
alexr00 authored and plainerman committed Feb 2, 2021
1 parent a347ce2 commit 62a163e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/vs/base/browser/ui/iconLabel/iconLabel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export class IconLabel extends Disposable {
};
IconLabel.adjustXAndShowCustomHover(hoverOptions, mouseX, hoverDelegate, isHovering);

const resolvedTooltip = await tooltip(tokenSource.token);
const resolvedTooltip = (await tooltip(tokenSource.token)) ?? (!isString(markdownTooltip) ? markdownTooltip.markdownNotSupportedFallback : undefined);
if (resolvedTooltip) {
hoverOptions = {
text: resolvedTooltip,
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/browser/parts/views/treeView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ class TreeRenderer extends Disposable implements ITreeRenderer<ITreeItem, FuzzyS
resolve(node.tooltip);
});
},
markdownNotSupportedFallback: resource ? undefined : '' // Passing undefined as the fallback for a resource falls back to the old native hover
markdownNotSupportedFallback: resource ? undefined : label ?? '' // Passing undefined as the fallback for a resource falls back to the old native hover
};
}

Expand Down

0 comments on commit 62a163e

Please sign in to comment.