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

Make each request id for doc and workspace diagnostics unique. #49343

Merged
1 commit merged into from Nov 13, 2020

Conversation

CyrusNajmabadi
Copy link
Member

The lsp client was calling into one type of diagnostic request with request-ids returned by the other type. This oculd lead to broken or inconsistent results. We now ensure the result ids are different so that this never considered legal.

// getting document diagnostics should not ask for workspace diagnostics with the result-ids it got for
// doc-diagnostics. The two systems are different and cannot share results, or do things like report
// what changed between each other.
var resultId = $"{GetType().Name}:{_nextDocumentResultId++}";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth just initializing a field with GetType().Name, since it won't change?

@ghost
Copy link

ghost commented Nov 13, 2020

Hello @CyrusNajmabadi!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approval

@ghost ghost merged commit 244896b into dotnet:master Nov 13, 2020
@ghost ghost added this to the Next milestone Nov 13, 2020
@CyrusNajmabadi CyrusNajmabadi deleted the requestId branch November 13, 2020 16:29
@allisonchou allisonchou modified the milestones: Next, 16.9.P2 Nov 24, 2020
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants