Skip to content

Commit 1e48847

Browse files
committed
Clean up
1 parent 856d647 commit 1e48847

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

src/vs/platform/terminal/common/capabilities/commandDetection/promptInputModel.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,18 @@ export class PromptInputModel extends Disposable implements IPromptInputModel {
5252
private readonly _xterm: Terminal,
5353
onCommandStart: Event<ITerminalCommand>,
5454
onCommandExecuted: Event<ITerminalCommand>,
55-
private readonly _logService: ILogService
55+
@ILogService private readonly _logService: ILogService
5656
) {
5757
super();
5858

5959
this._register(this._xterm.onData(e => this._handleInput(e)));
6060
this._register(this._xterm.onCursorMove(() => this._sync()));
61-
// TODO: Listen to the xterm textarea focus event?
6261

6362
this._register(onCommandStart(e => this._handleCommandStart(e as { marker: IMarker })));
6463
this._register(onCommandExecuted(() => this._handleCommandExecuted()));
6564
}
6665

6766
setContinuationPrompt(value: string): void {
68-
console.log('setContinuationPrompt', value);
6967
this._continuationPrompt = value;
7068
}
7169

@@ -77,7 +75,6 @@ export class PromptInputModel extends Disposable implements IPromptInputModel {
7775
this._state = PromptInputState.Input;
7876
this._commandStartMarker = command.marker;
7977
this._commandStartX = this._xterm.buffer.active.cursorX;
80-
console.log('commandStart', command.marker.line, this._commandStartX);
8178
this._onDidStartInput.fire();
8279
}
8380

@@ -91,7 +88,6 @@ export class PromptInputModel extends Disposable implements IPromptInputModel {
9188
}
9289

9390
private _handleInput(data: string) {
94-
this._logService.trace(`PromptInputModel#_handleInput data=${data}`);
9591
this._sync();
9692
}
9793

src/vs/platform/terminal/test/common/capabilities/commandDetection/promptInputModel.test.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,25 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils';
7-
import type { PromptInputModel } from 'vs/platform/terminal/common/capabilities/commandDetection/promptInputModel';
7+
import { NullLogService } from 'vs/platform/log/common/log';
8+
import { PromptInputModel } from 'vs/platform/terminal/common/capabilities/commandDetection/promptInputModel';
9+
import { Emitter } from 'vs/base/common/event';
10+
import type { ITerminalCommand } from 'vs/platform/terminal/common/capabilities/capabilities';
11+
12+
// eslint-disable-next-line local/code-import-patterns, local/code-amd-node-module
13+
import { Terminal } from '@xterm/headless';
814

915
suite('RequestStore', () => {
1016
const store = ensureNoDisposablesAreLeakedInTestSuite();
1117
let promptInputModel: PromptInputModel;
18+
let xterm: Terminal;
19+
let onCommandStart: Emitter<ITerminalCommand>;
20+
let onCommandExecuted: Emitter<ITerminalCommand>;
1221

1322
setup(() => {
14-
23+
xterm = new Terminal();
24+
onCommandStart = new Emitter();
25+
onCommandExecuted = new Emitter();
26+
promptInputModel = store.add(new PromptInputModel(xterm, onCommandStart.event, onCommandExecuted.event, new NullLogService));
1527
});
1628
});

0 commit comments

Comments
 (0)