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

Remove 'synchronize with build' internal functionality #72802

Merged
merged 1 commit into from
Apr 1, 2024

Conversation

CyrusNajmabadi
Copy link
Member

We do not want external errors flowing in and us having to manage their state through the DiagAnalyzerService.

Note: the external errors still flow in and are managed by the ExternalErrorDiagnosticUpdateSource. This allows features like allowing the user to suppress build-diagnostics, but can be done without the DiagAnalyzerService being involved. This pushes us to have entirely separate systems for live diags (DiagAnalyzerService) and external build diagnostics (ExternalErrorDiagnosticUpdateSource).

In an LSP-pull world, this works nicely. The build system and Roslyn are already communicating diagnostics with the host and the host owns things like squiggles and task list. The host also owns dedupe and superseding of live diags over build diags.

This will also allow us to trim down ExternalErrorDiagnosticUpdateSource and ProjectExternalErrorReporter in the future. Those systems have a complex eventing based approach that nothing in roslyn currently listens to. So we can remove those events in teh future, and just use these as a buffer of build-errors for the rare features that need to know this (currently, only the ability to suppress a build-only diagnostic).

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner March 29, 2024 15:19
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Mar 29, 2024
@CyrusNajmabadi
Copy link
Member Author

@mavasani ptal, and let me know if my understanding of these capabilities is correct.

var projectStateSets = project.SupportsCompilation
? GetOrUpdateProjectStateSets(project)
: ProjectAnalyzerStateSets.Default;
var hostStateSets = GetOrCreateHostStateSets(project, projectStateSets);
Copy link
Member Author

Choose a reason for hiding this comment

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

aside, i'd love to know what the different state sets all mean.

Copy link
Contributor

Choose a reason for hiding this comment

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

HostStateSets - state sets corresponding to analyzers coming from installed analyzer VSIXes, which are applicable for any project opened in the VS Session. The most common use case is for our built-in IDE code style analyzers that ship in Features.dll inside Roslyn VSIX installed with VS.

ProjectStateSets - state sets corresponding to analyzers coming from installed analyzer NuGet packages, which are applicable only to the specific project.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh. That's very helpful. Thanks!!

@@ -212,8 +214,6 @@ async ValueTask ClearErrorsCoreAsync(ProjectId projectId, Solution solution, InP
ProcessAndRaiseDiagnosticsUpdated(argsBuilder.ToImmutableAndClear());
}

await SetLiveErrorsForProjectAsync(projectId, ImmutableArray<DiagnosticData>.Empty, GetApplicableCancellationToken(state)).ConfigureAwait(false);
Copy link
Member Author

Choose a reason for hiding this comment

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

this method only existed to forward to the diagservice, and so it got removed.

}

private async ValueTask SetLiveErrorsForProjectAsync(ProjectId projectId, InProgressState state)
private static void SetLiveErrorsForProject(ProjectId projectId, InProgressState state)
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 possible to now remove this method completely? Is there anything related to live errors that needs to be implemented in this type now?

Copy link
Member Author

Choose a reason for hiding this comment

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

will do in followup :)

@CyrusNajmabadi CyrusNajmabadi merged commit 769c1b1 into dotnet:main Apr 1, 2024
27 checks passed
@CyrusNajmabadi CyrusNajmabadi deleted the syncBuild branch April 1, 2024 16:32
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Apr 1, 2024
@dibarbet dibarbet modified the milestones: Next, 17.11 P1 Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants