[LSP] Switch to project version caching instead of sln crawler events pull diagnostics#57380
Merged
dibarbet merged 6 commits intodotnet:mainfrom Oct 28, 2021
Merged
Conversation
dibarbet
commented
Oct 26, 2021
| // Second doc should show up as unchanged. | ||
| Assert.Null(results2[1].Diagnostics); | ||
| Assert.Equal(results[1].ResultId, results2[1].ResultId); | ||
| // Second doc should be changed as the project has changed. |
Member
Author
There was a problem hiding this comment.
Previously, diagnostic change events only told us changes to the actual diagnostics. So even if the diagnostics had to be recalculated, LSP wouldn't know unless the diagnostics actually changed. Now that we're looking at project version, we will return updated diagnostics even if the end result of the calculation is the same.
CyrusNajmabadi
approved these changes
Oct 26, 2021
1dadef2 to
6d9e48f
Compare
| // Note that these checksums should only actually be calculated once, if the project is unchanged | ||
| // the same checksum will be returned. | ||
| var referencedProjectChecksum = await referencedProject.State.GetChecksumAsync(cancellationToken).ConfigureAwait(false); | ||
| tempChecksumArray.Add(referencedProjectChecksum); |
Contributor
There was a problem hiding this comment.
we likely need to do this recursively right? or, if not, please document why not.
Member
Author
There was a problem hiding this comment.
yup, thinking now that definitely needs to happen. Will also add a test for that scenario
CyrusNajmabadi
approved these changes
Oct 28, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This changes us from listening to diagnostic service events to using project versions to determine when to re-calculate diagnostics. This is helpful as we do not necessarily have access to the sln crawler outside of VS.