mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-01 14:01:38 +01:00
Custom tooltip on the remote indicator. Fixes #126494
This commit is contained in:
@@ -83,6 +83,10 @@ class ResourceLabelFormattersHandler implements IWorkbenchContribution {
|
||||
constructor(@ILabelService labelService: ILabelService) {
|
||||
resourceLabelFormattersExtPoint.setHandler((extensions, delta) => {
|
||||
delta.added.forEach(added => added.value.forEach(formatter => {
|
||||
if (!added.description.enableProposedApi && formatter.formatting.workspaceTooltip) {
|
||||
// workspaceTooltip is only proposed
|
||||
formatter.formatting.workspaceTooltip = undefined;
|
||||
}
|
||||
this.formattersDisposables.set(formatter, labelService.registerFormatter(formatter));
|
||||
}));
|
||||
delta.removed.forEach(removed => removed.value.forEach(formatter => {
|
||||
@@ -249,6 +253,11 @@ export class LabelService extends Disposable implements ILabelService {
|
||||
return formatter?.workspaceSuffix || '';
|
||||
}
|
||||
|
||||
getHostTooltip(scheme: string, authority?: string): string | undefined {
|
||||
const formatter = this.findFormatting(URI.from({ scheme, authority }));
|
||||
return formatter?.workspaceTooltip;
|
||||
}
|
||||
|
||||
registerFormatter(formatter: ResourceLabelFormatter): IDisposable {
|
||||
this.formatters.push(formatter);
|
||||
this._onDidChangeFormatters.fire({ scheme: formatter.scheme });
|
||||
|
||||
Reference in New Issue
Block a user