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