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

Add BuildOnlyDiagnosticIds LSP request handler #69475

Merged
merged 3 commits into from
Sep 21, 2023

Conversation

mavasani
Copy link
Contributor

Work towards dotnet/vscode-csharp#5728

Exposes an LSP API to fetch build-only diagnostic IDs for the given solution snapshot. This API will be invoked from VSCode C# extension on execution of explicit build/rebuild commands to separate out build-only and live diagnostics. See dotnet/vscode-csharp#5728 (comment) for details.

Work towards dotnet/vscode-csharp#5728

Exposes an LSP API to fetch build-only diagnostic IDs for the given solution snapshot. This API will be invoked from VSCode C# extension on execution of explicit build/rebuild commands to separate out build-only and live diagnostics. See dotnet/vscode-csharp#5728 (comment) for details.
@mavasani mavasani requested a review from a team as a code owner August 11, 2023 09:18
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Aug 11, 2023
mavasani added a commit to mavasani/vscode-csharp that referenced this pull request Aug 11, 2023
Work towards dotnet#5728. Follow-up to dotnet/roslyn#69475.

C# extension can now invoke `getBuildOnlyDiagnosticIds` API after each explicit build/rebuild command to identify build-only diagnostic IDs.
@mavasani
Copy link
Contributor Author

ping @genlu @CyrusNajmabadi for review

@mavasani
Copy link
Contributor Author

@genlu @CyrusNajmabadi can you please review?

@beccamc beccamc merged commit bd11e7a into dotnet:main Sep 21, 2023
24 checks passed
@ghost ghost added this to the Next milestone Sep 21, 2023
internal sealed class BuildOnlyDiagnosticIdsHandler(
DiagnosticAnalyzerInfoCache.SharedGlobalCache globalCache,
[ImportMany] IEnumerable<Lazy<ILspBuildOnlyDiagnostics, ILspBuildOnlyDiagnosticsMetadata>> compilerBuildOnlyDiagnosticsProviders)
: ILspServiceRequestHandler<BuildOnlyDiagnosticIdsResult>
Copy link
Member

Choose a reason for hiding this comment

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

indentation.

[ImportMany] IEnumerable<Lazy<ILspBuildOnlyDiagnostics, ILspBuildOnlyDiagnosticsMetadata>> compilerBuildOnlyDiagnosticsProviders)
: ILspServiceRequestHandler<BuildOnlyDiagnosticIdsResult>
{
public const string BuildOnlyDiagnosticIdsMethodName = "workspace/buildOnlyDiagnosticIds";
Copy link
Member

Choose a reason for hiding this comment

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

is this a well known lsp method? or a roslyn extension?

public const string BuildOnlyDiagnosticIdsMethodName = "workspace/buildOnlyDiagnosticIds";

private readonly DiagnosticAnalyzerInfoCache.SharedGlobalCache _globalCache = globalCache;
private readonly ImmutableDictionary<string, string[]> _compilerBuildOnlyDiagnosticIds = compilerBuildOnlyDiagnosticsProviders
Copy link
Member

Choose a reason for hiding this comment

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

nit: _languageNameToBuildOnlyDiagnosticIds

Copy link
Member

@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.

lgtm.

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.

5 participants