show extension name with id, show title also on severity-label, #21302

This commit is contained in:
Johannes Rieken
2017-08-21 15:23:46 +02:00
parent 1caf0fa481
commit c98952880c
5 changed files with 16 additions and 13 deletions

View File

@@ -11,7 +11,7 @@ import { Action } from 'vs/base/common/actions';
import { TPromise as Promise } from 'vs/base/common/winjs.base';
import { MainThreadMessageServiceShape, MainContext, IExtHostContext, MainThreadMessageOptions } from '../node/extHost.protocol';
import { extHostNamedCustomer } from "vs/workbench/api/electron-browser/extHostCustomers";
import { IExtensionService } from 'vs/platform/extensions/common/extensions';
import { IExtensionService, IExtensionDescription } from 'vs/platform/extensions/common/extensions';
@extHostNamedCustomer(MainContext.MainThreadMessageService)
export class MainThreadMessageService implements MainThreadMessageServiceShape {
@@ -33,11 +33,11 @@ export class MainThreadMessageService implements MainThreadMessageServiceShape {
if (options.modal) {
return this._showModalMessage(severity, message, commands);
} else {
return this._showMessage(severity, message, commands, options.extensionId);
return this._showMessage(severity, message, commands, options.extension);
}
}
private _showMessage(severity: Severity, message: string, commands: { title: string; isCloseAffordance: boolean; handle: number; }[], extensionId: string): Thenable<number> {
private _showMessage(severity: Severity, message: string, commands: { title: string; isCloseAffordance: boolean; handle: number; }[], extension: IExtensionDescription): Thenable<number> {
return new Promise<number>(resolve => {
@@ -72,7 +72,7 @@ export class MainThreadMessageService implements MainThreadMessageServiceShape {
messageHide = this._messageService.show(severity, {
message,
actions,
source: extensionId
source: `${extension.name} (${extension.id})`
});
});
}