Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve queues, (one effect: improve code completion) #4310

Merged
merged 8 commits into from
Jan 4, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/omnisharp/prioritization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ const priorityCommands = [
];

const normalCommands = [
protocol.Requests.Completion,
protocol.Requests.CompletionResolve,
protocol.Requests.AutoComplete,
an-dr-eas-k marked this conversation as resolved.
Show resolved Hide resolved
protocol.Requests.FilesChanged,
protocol.Requests.FindSymbols,
Expand Down
5 changes: 4 additions & 1 deletion src/omnisharp/requestQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface Request {
onError(err: any): void;
startTime?: number;
endTime?: number;
id?: number;
}

/**
Expand Down Expand Up @@ -62,7 +63,9 @@ class RequestQueue {
request.onError(new Error(`Pending request cancelled: ${request.command}`));
}

// TODO: Handle cancellation of a request already waiting on the OmniSharp server.
if (request.id){
this.dequeue(request.id);
}
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/omnisharp/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,8 @@ export class OmniSharpServer {

private _makeRequest(request: Request) {
const id = OmniSharpServer._nextId++;

request.id = id;

333fred marked this conversation as resolved.
Show resolved Hide resolved
const requestPacket: protocol.WireProtocol.RequestPacket = {
Type: 'request',
Seq: id,
Expand Down