提交 4fde7a37 编写于 作者: J Johannes Rieken

add main-side logging for save participants, #42013

上级 1d106e5a
...@@ -27,6 +27,7 @@ import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; ...@@ -27,6 +27,7 @@ import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { IProgressService2, ProgressLocation } from 'vs/platform/progress/common/progress'; import { IProgressService2, ProgressLocation } from 'vs/platform/progress/common/progress';
import { localize } from 'vs/nls'; import { localize } from 'vs/nls';
import { isFalsyOrEmpty } from 'vs/base/common/arrays'; import { isFalsyOrEmpty } from 'vs/base/common/arrays';
import { ILogService } from 'vs/platform/log/common/log';
export interface ISaveParticipantParticipant extends ISaveParticipant { export interface ISaveParticipantParticipant extends ISaveParticipant {
// progressMessage: string; // progressMessage: string;
...@@ -279,8 +280,9 @@ export class SaveParticipant implements ISaveParticipant { ...@@ -279,8 +280,9 @@ export class SaveParticipant implements ISaveParticipant {
constructor( constructor(
extHostContext: IExtHostContext, extHostContext: IExtHostContext,
@IInstantiationService instantiationService: IInstantiationService,
@IProgressService2 private _progressService: IProgressService2, @IProgressService2 private _progressService: IProgressService2,
@IInstantiationService instantiationService: IInstantiationService @ILogService private _logService: ILogService
) { ) {
this._saveParticipants = [ this._saveParticipants = [
instantiationService.createInstance(TrimWhitespaceParticipant), instantiationService.createInstance(TrimWhitespaceParticipant),
...@@ -303,7 +305,7 @@ export class SaveParticipant implements ISaveParticipant { ...@@ -303,7 +305,7 @@ export class SaveParticipant implements ISaveParticipant {
const promiseFactory = this._saveParticipants.map(p => () => { const promiseFactory = this._saveParticipants.map(p => () => {
return Promise.resolve(p.participate(model, env)); return Promise.resolve(p.participate(model, env));
}); });
return sequence(promiseFactory).then(() => { }); return sequence(promiseFactory).then(() => { }, err => this._logService.error(err));
}); });
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册