mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 04:09:28 +00:00
Add pending commands in queue order
This commit is contained in:
@@ -60,9 +60,13 @@ export class RequestQueue {
|
|||||||
return this.queue.shift();
|
return this.queue.shift();
|
||||||
}
|
}
|
||||||
|
|
||||||
public getQueuedCommands(): string[] {
|
public getQueuedCommands(skipLast: boolean = false): string[] {
|
||||||
const result: string[] = [];
|
const result: string[] = [];
|
||||||
for (let i = this.queue.length - 1; i >= 0; i--) {
|
const end = skipLast ? this.queue.length - 1 : this.queue.length;
|
||||||
|
if (end <= 0) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
for (let i = 0; i < end; i++) {
|
||||||
const item = this.queue[i];
|
const item = this.queue[i];
|
||||||
result.push(item.request.command);
|
result.push(item.request.command);
|
||||||
if (result.length >= 5) {
|
if (result.length >= 5) {
|
||||||
|
|||||||
@@ -292,7 +292,7 @@ export class SingleTsServer extends Disposable implements ITypeScriptServer {
|
|||||||
pendingResponses
|
pendingResponses
|
||||||
};
|
};
|
||||||
if (queueLength > 0) {
|
if (queueLength > 0) {
|
||||||
data.queuedCommands = this._requestQueue.getQueuedCommands();
|
data.queuedCommands = this._requestQueue.getQueuedCommands(true);
|
||||||
}
|
}
|
||||||
if (pendingResponses > 0) {
|
if (pendingResponses > 0) {
|
||||||
data.pendingCommands = this.getPendingCommands();
|
data.pendingCommands = this.getPendingCommands();
|
||||||
|
|||||||
Reference in New Issue
Block a user