Logs the message as "error" and, if given, offers actions to act on it.
the message to log.
the actions to offer. Can be omitted.
the selected action if there is any, undefined
when there was no action or none was selected.
Logs the message as "error" and, if given, offers actions to act on it.
the message to log.
additional options. Can be omitted
the actions to offer. Can be omitted.
the selected action if there is any, undefined
when there was no action or none was selected.
Logs the message as "info" and, if given, offers actions to act on it.
the message to log.
the actions to offer. Can be omitted.
the selected action if there is any, undefined
when there was no action or none was selected.
Logs the message as "info" and, if given, offers actions to act on it.
the message to log.
additional options. Can be omitted
the actions to offer. Can be omitted.
the selected action if there is any, undefined
when there was no action or none was selected.
Logs the message and, if given, offers actions to act on it.
the message to log.
the actions to offer. Can be omitted.
the selected action if there is any, undefined
when there was no action or none was selected.
Logs the message and, if given, offers actions to act on it.
the message to log.
additional options. Can be omitted
the actions to offer. Can be omitted.
the selected action if there is any, undefined
when there was no action or none was selected.
Shows the given message as a progress.
the message to show for the progress.
an optional callback which will be invoked if the progress indicator was canceled.
a promise resolving to a Progress object with which the progress can be updated.
@inject(MessageService)
protected readonly messageService: MessageService;
// this will show "Progress" as a cancelable message
this.messageService.showProgress({text: 'Progress'});
// this will show "Rolling back" with "Cancel" and an additional "Skip" action
this.messageService.showProgress({
text: `Rolling back`,
actions: ["Skip"],
},
() => console.log("canceled"))
.then((progress) => {
// register if interested in the result (only necessary for custom actions)
progress.result.then((result) => {
// will be 'Cancel', 'Skip' or `undefined`
console.log("result is", result);
});
progress.report({message: "Cleaning references", work: {done: 10, total: 100}});
progress.report({message: "Restoring previous state", work: {done: 80, total: 100}});
progress.report({message: "Complete", work: {done: 100, total: 100}});
// we are done so we can cancel the progress message, note that this will also invoke `onDidCancel`
progress.cancel();
});
Logs the message as "warning" and, if given, offers actions to act on it.
the message to log.
the actions to offer. Can be omitted.
the selected action if there is any, undefined
when there was no action or none was selected.
Logs the message as "warning" and, if given, offers actions to act on it.
the message to log.
additional options. Can be omitted
the actions to offer. Can be omitted.
the selected action if there is any, undefined
when there was no action or none was selected.
Service to log and categorize messages, show progress information and offer actions.
The messages are processed by this service and forwarded to an injected MessageClient. For example "@theia/messages" provides such a client, rendering messages as notifications in the frontend.
Example usage