-
Notifications
You must be signed in to change notification settings - Fork 4k
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 build-only diagnostics functionality no longer used in product #72941
Conversation
public IWorkspaceService CreateService(HostWorkspaceServices workspaceServices) | ||
=> new BuildOnlyDiagnosticsService(workspaceServices.Workspace); | ||
|
||
private sealed class BuildOnlyDiagnosticsService : IBuildOnlyDiagnosticsService | ||
{ | ||
private readonly object _gate = new(); | ||
private readonly Dictionary<DocumentId, ImmutableArray<DiagnosticData>> _documentDiagnostics = []; | ||
private readonly Dictionary<ProjectId, ImmutableArray<DiagnosticData>> _projectDiagnostics = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data in this was never read in any product code. only in a single test. remove it, and updated codepaths affected by it.
@@ -61,18 +56,12 @@ private void OnWorkspaceChanged(object? sender, WorkspaceChangeEventArgs e) | |||
} | |||
} | |||
|
|||
public void AddBuildOnlyDiagnostics(Solution solution, ProjectId? projectId, DocumentId? documentId, ImmutableArray<DiagnosticData> diagnostics) | |||
public void AddBuildOnlyDiagnostics(DocumentId documentId, ImmutableArray<DiagnosticData> diagnostics) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since nothing was reading the project side, we only need to call this for teh document side of things.
foreach (var documentId in project.DocumentIds) | ||
_documentDiagnostics.Remove(documentId); | ||
} | ||
} | ||
|
||
public void ClearBuildOnlyDiagnostics(Solution solution, ProjectId? projectId, DocumentId? documentId) | ||
public void ClearBuildOnlyDiagnostics(Project project, DocumentId? documentId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
passing in a project-id here meant 'clear out project diags, and all diags for any document in this project'. So, maintaining that logic here.
} | ||
} | ||
|
||
public ImmutableArray<DiagnosticData> GetBuildOnlyDiagnostics(ProjectId projectId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only called in a single test method, no other product code called this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.