Skip to content

Respond with updated diagnostics when EnC diagnostics state is different#60081

Merged
davidwengier merged 11 commits intodotnet:mainfrom
davidwengier:LSPStaleDignosticsFromHotReload
Mar 13, 2022
Merged

Respond with updated diagnostics when EnC diagnostics state is different#60081
davidwengier merged 11 commits intodotnet:mainfrom
davidwengier:LSPStaleDignosticsFromHotReload

Conversation

@davidwengier
Copy link
Copy Markdown
Member

@davidwengier davidwengier commented Mar 10, 2022

Fixes AB#1481208

See discussion in LSPPod (which for some reason I can't link to ¯\_(ツ)_/¯) for context. If there is an obviously better solution here, I'm all ears!

@davidwengier davidwengier requested a review from a team as a code owner March 10, 2022 04:58
@ghost ghost added the Area-IDE label Mar 10, 2022
{
_previouslyHadDiagnostics = false;
_diagnosticsVersion++;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

any concern about threadsafety?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

These methods are called in exactly one spot, and the caller didn't seem to worry, so I didn't worry. I'm sure @tmat can comment more though

Copy link
Copy Markdown
Contributor

@CyrusNajmabadi CyrusNajmabadi left a comment

Choose a reason for hiding this comment

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

honestly, this looks fine to me. To @dibarbet if he has concerns. It's a bit ugly that diagnostics has to know about enc, but i can't think of a better way myself.

@davidwengier
Copy link
Copy Markdown
Member Author

It's a bit ugly that diagnostics has to know about enc

I agree. A better checksum that knew when a build had been done would be ideal I think.

@dibarbet
Copy link
Copy Markdown
Member

honestly, this looks fine to me. To @dibarbet if he has concerns. It's a bit ugly that diagnostics has to know about enc, but i can't think of a better way myself.

I agree this is fine for now - lets wait to see if we encounter more similar issues before doing something more complex

// Even though we only report diagnostics, and not rude edits, we still need to
// ensure that the presence of rude edits are considered when we decide to update
// our version number.
if (diagnostics.Any() || rudeEdits.Any(d => d.Diagnostics.Any()))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Diagnostics

The array in rudeEdits won't ever be empty for a given document. So you can just check if the outer array is empty.

Copy link
Copy Markdown
Member

@tmat tmat left a comment

Choose a reason for hiding this comment

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

Seems ok as a workaround. Hopefully we'll be able to replace this with a better system once we remove solution crawler and fully switch to pull diagnostics.

@davidwengier davidwengier enabled auto-merge (squash) March 10, 2022 21:16
@davidwengier
Copy link
Copy Markdown
Member Author

/azp run roslyn-integration-corehost

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@davidwengier
Copy link
Copy Markdown
Member Author

/azp run roslyn-integration-corehost

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@davidwengier
Copy link
Copy Markdown
Member Author

Build finally green. Conflicts. FML.

@davidwengier
Copy link
Copy Markdown
Member Author

/azp run roslyn-integration-corehost

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@davidwengier
Copy link
Copy Markdown
Member Author

/azp run roslyn-integration-corehost

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@davidwengier
Copy link
Copy Markdown
Member Author

/azp run roslyn-integration-corehost

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@davidwengier davidwengier merged commit c8d19cd into dotnet:main Mar 13, 2022
@ghost ghost added this to the Next milestone Mar 13, 2022
@davidwengier davidwengier deleted the LSPStaleDignosticsFromHotReload branch March 13, 2022 09:05
@allisonchou allisonchou modified the milestones: Next, 17.2.P3 Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants