提交 41626d12 编写于 作者: B Benjamin Pasero

hook in opener service

上级 c5d4092d
......@@ -60,7 +60,7 @@ export class NotificationList extends Themable {
WorkbenchList,
this.listContainer,
new NotificationsDelegate(),
[new NotificationRenderer()],
[this.instantiationService.createInstance(NotificationRenderer)],
{ ariaLabel: localize('notificationsList', "Notifications List") } as IListOptions<INotificationViewItem>
);
......
......@@ -10,6 +10,9 @@ import { IDelegate, IRenderer } from 'vs/base/browser/ui/list/list';
import { INotificationViewItem, NotificationViewItem } from 'vs/workbench/services/notification/common/notificationsModel';
import { renderMarkdown } from 'vs/base/browser/htmlContentRenderer';
import { clearNode } from 'vs/base/browser/dom';
import { IOpenerService } from 'vs/platform/opener/common/opener';
import URI from 'vs/base/common/uri';
import { onUnexpectedError } from 'vs/base/common/errors';
export class NotificationsDelegate implements IDelegate<INotificationViewItem> {
......@@ -42,6 +45,11 @@ export class NotificationRenderer implements IRenderer<INotificationViewItem, IN
'tablerow'
];
constructor(
@IOpenerService private openerService: IOpenerService
) {
}
public get templateId() {
return NotificationRenderer.ID;
}
......@@ -66,7 +74,8 @@ export class NotificationRenderer implements IRenderer<INotificationViewItem, IN
clearNode(data.message);
data.message.appendChild(renderMarkdown(element.message, {
inline: true,
joinRendererConfiguration: renderer => NotificationRenderer.MARKED_NOOP_TARGETS.forEach(fn => renderer[fn] = NotificationRenderer.MARKED_NOOP)
joinRendererConfiguration: renderer => NotificationRenderer.MARKED_NOOP_TARGETS.forEach(fn => renderer[fn] = NotificationRenderer.MARKED_NOOP),
actionCallback: (content: string) => this.openerService.open(URI.parse(content)).then(void 0, onUnexpectedError)
}));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册