Skip to content

Commit

Permalink
#53526 MIgrate from TPromise in log
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 committed Nov 9, 2018
1 parent 33b19e1 commit 6732922
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/vs/platform/log/node/logIpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@
*--------------------------------------------------------------------------------------------*/

import { IChannel } from 'vs/base/parts/ipc/node/ipc';
import { TPromise } from 'vs/base/common/winjs.base';
import { LogLevel, ILogService, DelegatedLogService } from 'vs/platform/log/common/log';
import { Event, buffer } from 'vs/base/common/event';

export interface ILogLevelSetterChannel extends IChannel {
listen(event: 'onDidChangeLogLevel'): Event<LogLevel>;
listen<T>(event: string, arg?: any): Event<T>;

call(command: 'setLevel', logLevel: LogLevel): TPromise<void>;
call(command: string, arg?: any): TPromise<any>;
call(command: 'setLevel', logLevel: LogLevel): void;
call(command: string, arg?: any): Thenable<any>;
}

export class LogLevelSetterChannel implements ILogLevelSetterChannel {
Expand All @@ -32,9 +31,9 @@ export class LogLevelSetterChannel implements ILogLevelSetterChannel {
throw new Error(`Event not found: ${event}`);
}

call(command: string, arg?: any): TPromise<any> {
call(command: string, arg?: any): Thenable<any> {
switch (command) {
case 'setLevel': this.service.setLevel(arg); return TPromise.as(null);
case 'setLevel': this.service.setLevel(arg);
}

throw new Error(`Call not found: ${command}`);
Expand All @@ -49,8 +48,8 @@ export class LogLevelSetterChannelClient {
return this.channel.listen('onDidChangeLogLevel');
}

setLevel(level: LogLevel): TPromise<void> {
return this.channel.call('setLevel', level);
setLevel(level: LogLevel): void {
this.channel.call('setLevel', level);
}
}

Expand Down

0 comments on commit 6732922

Please sign in to comment.