Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/EditorFeatures/Test2/CodeFixes/CodeFixServiceTests.vb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Namespace Microsoft.CodeAnalysis.Editor.Implementation.CodeFixes.UnitTests
' Verify available diagnostics
Dim document = project.Documents.Single()
Dim diagnostics = Await diagnosticService.GetDiagnosticsForSpanAsync(document,
range:=(Await document.GetSyntaxRootAsync()).FullSpan, CancellationToken.None)
range:=(Await document.GetSyntaxRootAsync()).FullSpan, DiagnosticKind.All, includeSuppressedDiagnostics:=False, CancellationToken.None)

Assert.Equal(1, diagnostics.Count())

Expand Down Expand Up @@ -140,7 +140,7 @@ Namespace Microsoft.CodeAnalysis.Editor.Implementation.CodeFixes.UnitTests
' Verify available diagnostics
Dim document = project.Documents.Single()
Dim diagnostics = Await diagnosticService.GetDiagnosticsForSpanAsync(document,
range:=(Await document.GetSyntaxRootAsync()).FullSpan, CancellationToken.None)
range:=(Await document.GetSyntaxRootAsync()).FullSpan, DiagnosticKind.All, includeSuppressedDiagnostics:=False, CancellationToken.None)

Assert.Equal(1, diagnostics.Count())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,8 @@ void Method()
fixers: [],
[suppressionProviderFactory]);
var document = GetDocumentAndSelectSpan(workspace, out var span);
var diagnostics = await diagnosticService.GetDiagnosticsForSpanAsync(document, span, CancellationToken.None);
var diagnostics = await diagnosticService.GetDiagnosticsForSpanAsync(
document, span, DiagnosticKind.All, includeSuppressedDiagnostics: false, CancellationToken.None);
Assert.Equal(2, diagnostics.Where(d => d.Id == "CS0219").Count());

var allFixes = (await fixService.GetFixesAsync(document, span, CancellationToken.None))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,6 @@ Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForSpanAsync(

internal static class IDiagnosticAnalyzerServiceExtensions
{
/// <summary>
/// Return up to date diagnostics for the given <paramref name="range"/> for the given <paramref name="document"/>.
/// <para>
/// This can be expensive since it is force analyzing diagnostics if it doesn't have up-to-date one yet.
/// </para>
/// </summary>
public static Task<ImmutableArray<DiagnosticData>> GetDiagnosticsForSpanAsync(this IDiagnosticAnalyzerService service,
TextDocument document, TextSpan? range, CancellationToken cancellationToken)
=> service.GetDiagnosticsForSpanAsync(document, range, DiagnosticKind.All, includeSuppressedDiagnostics: false, cancellationToken);

/// <summary>
/// Return up to date diagnostics of the given <paramref name="diagnosticKind"/> for the given <paramref name="range"/>
/// for the given <paramref name="document"/>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public override async Task<ImmutableArray<DiagnosticData>> GetDiagnosticsAsync(
if (Document is SourceGeneratedDocument sourceGeneratedDocument)
{
// Unfortunately GetDiagnosticsForIdsAsync returns nothing for source generated documents.
var documentDiagnostics = await diagnosticAnalyzerService.GetDiagnosticsForSpanAsync(sourceGeneratedDocument, range: null, cancellationToken: cancellationToken).ConfigureAwait(false);
var documentDiagnostics = await diagnosticAnalyzerService.GetDiagnosticsForSpanAsync(
sourceGeneratedDocument, range: null, DiagnosticKind.All, includeSuppressedDiagnostics: false, cancellationToken).ConfigureAwait(false);
return documentDiagnostics;
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ internal static class Diagnostics
var globalOptionsService = document.Project.Solution.Services.ExportProvider.GetService<IGlobalOptionService>();
var diagnosticAnalyzerService = document.Project.Solution.Services.ExportProvider.GetService<IDiagnosticAnalyzerService>();

var diagnostics = await diagnosticAnalyzerService.GetDiagnosticsForSpanAsync(document, range: null, cancellationToken).ConfigureAwait(false);
var diagnostics = await diagnosticAnalyzerService.GetDiagnosticsForSpanAsync(
document, range: null, DiagnosticKind.All, includeSuppressedDiagnostics: false, cancellationToken).ConfigureAwait(false);

var project = document.Project;
// isLiveSource means build might override a diagnostics, but this method is only used by tooling, so builds aren't relevant
Expand Down
Loading