Skip to content

Commit 0151910

Browse files
Merge pull request #914 from DustinCampbell/missing-commits
A couple of commits that were missed from the future branch
2 parents 50fbecb + 9f429c9 commit 0151910

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

src/omnisharp/server.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ export class OmniSharpServer {
6060
private static _nextId = 1;
6161
private static StartupTimeout = 1000 * 60;
6262

63+
private _debugMode: boolean = false;
64+
6365
private _readLine: ReadLine;
6466
private _disposables: vscode.Disposable[] = [];
6567

@@ -84,7 +86,12 @@ export class OmniSharpServer {
8486

8587
this._channel = vscode.window.createOutputChannel('OmniSharp Log');
8688
this._logger = new Logger(message => this._channel.append(message));
87-
this._requestQueue = new RequestQueueCollection(this._logger, 8, request => this._makeRequest(request));
89+
90+
const logger = this._debugMode
91+
? this._logger
92+
: new Logger(message => { });
93+
94+
this._requestQueue = new RequestQueueCollection(logger, 8, request => this._makeRequest(request));
8895
}
8996

9097
public isRunning(): boolean {
@@ -411,10 +418,6 @@ export class OmniSharpServer {
411418
};
412419

413420
this._requestQueue.enqueue(request);
414-
415-
if (this._getState() === ServerState.Started) {
416-
this._requestQueue.drain();
417-
}
418421
});
419422

420423
if (token) {
@@ -528,6 +531,8 @@ export class OmniSharpServer {
528531
else {
529532
request.onError(packet.Message || packet.Body);
530533
}
534+
535+
this._requestQueue.drain();
531536
}
532537

533538
private _handleEventPacket(packet: protocol.WireProtocol.EventPacket): void {
@@ -551,7 +556,9 @@ export class OmniSharpServer {
551556
Arguments: request.data
552557
};
553558

554-
this._logger.appendLine(`Making request: ${request.command} (${id})`);
559+
if (this._debugMode) {
560+
this._logger.appendLine(`Making request: ${request.command} (${id})`);
561+
}
555562

556563
this._serverProcess.stdin.write(JSON.stringify(requestPacket) + '\n');
557564

@@ -564,7 +571,7 @@ export class OmniSharpServer {
564571
const output = `[${logLevel}:${name}] ${message}`;
565572

566573
// strip stuff like: /codecheck: 200 339ms
567-
if (!timing200Pattern.test(output)) {
574+
if (this._debugMode || !timing200Pattern.test(output)) {
568575
this._logger.appendLine(output);
569576
}
570577
}

0 commit comments

Comments
 (0)