Skip to content

Commit 20e3473

Browse files
committed
Extract ITraceRpcArgs type
1 parent 2a3d4aa commit 20e3473

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/vs/platform/terminal/node/ptyService.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,18 @@ import { hasKey } from '../../../base/common/types.js';
3737
type XtermTerminal = pkg.Terminal;
3838
const { Terminal: XtermTerminal } = pkg;
3939

40+
interface ITraceRpcArgs {
41+
logService: ILogService;
42+
simulatedLatency: number;
43+
}
44+
4045
export function traceRpc(_target: Object, key: string, descriptor: PropertyDescriptor) {
4146
if (typeof descriptor.value !== 'function') {
4247
throw new Error('not supported');
4348
}
4449
const fnKey = 'value';
4550
const fn = descriptor.value;
46-
descriptor[fnKey] = async function <TThis extends { traceRpcArgs: { logService: ILogService; simulatedLatency: number } }>(this: TThis, ...args: unknown[]) {
51+
descriptor[fnKey] = async function <TThis extends { traceRpcArgs: ITraceRpcArgs }>(this: TThis, ...args: unknown[]) {
4752
if (this.traceRpcArgs.logService.getLevel() === LogLevel.Trace) {
4853
this.traceRpcArgs.logService.trace(`[RPC Request] PtyService#${fn.name}(${args.map(e => JSON.stringify(e)).join(', ')})`);
4954
}
@@ -123,7 +128,7 @@ export class PtyService extends Disposable implements IPtyService {
123128
}
124129

125130
@memoize
126-
get traceRpcArgs(): { logService: ILogService; simulatedLatency: number } {
131+
get traceRpcArgs(): ITraceRpcArgs {
127132
return {
128133
logService: this._logService,
129134
simulatedLatency: this._simulatedLatency

0 commit comments

Comments
 (0)