Skip to content

Commit

Permalink
Add a bit more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
DustinCampbell committed Nov 11, 2016
1 parent 9b50f56 commit 64df4ec
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/omnisharp/requestQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class RequestQueue {
* Enqueue a new request.
*/
public enqueue(request: Request) {
this._logger.appendLine(`Enqueue request for ${request.command}.`);
this._logger.appendLine(`Enqueue ${this._name} request for ${request.command}.`);
this._pending.push(request);
}

Expand All @@ -47,7 +47,7 @@ class RequestQueue {

if (request) {
this._waiting.delete(id);
this._logger.appendLine(`Dequeue request for ${request.command}.`);
this._logger.appendLine(`Dequeue ${this._name} request for ${request.command} (${id}).`);
}

return request;
Expand Down Expand Up @@ -87,6 +87,9 @@ class RequestQueue {
return;
}

this._logger.appendLine(`Processing ${this._name} queue`);
this._logger.increaseIndent();

const slots = this._maxSize - this._waiting.size;

for (let i = 0; i < slots && this._pending.length > 0; i++) {
Expand All @@ -97,9 +100,11 @@ class RequestQueue {
this._waiting.set(id, item);

if (this.isFull()) {
return;
break;
}
}

this._logger.decreaseIndent();
}
}

Expand Down

0 comments on commit 64df4ec

Please sign in to comment.