diff --git a/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionsSource.cs b/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionsSource.cs index 885ccbc2995fd..c21824c6f0438 100644 --- a/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionsSource.cs +++ b/src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionsSource.cs @@ -237,14 +237,11 @@ await InvokeBelowInputPriorityAsync(() => var result = await state.Target.Owner._codeFixService.GetMostSevereFixAsync( document, range.Span.ToTextSpan(), priorityProvider, fallbackOptions, cancellationToken).ConfigureAwait(false); - if (result.HasFix) + if (result != null) { Logger.Log(FunctionId.SuggestedActions_HasSuggestedActionsAsync); - return GetFixCategory(result.CodeFixCollection.FirstDiagnostic.Severity); + return GetFixCategory(result.FirstDiagnostic.Severity); } - - if (!result.UpToDate) - return null; } return null; diff --git a/src/EditorFeatures/Test2/Diagnostics/DiagnosticServiceTests.vb b/src/EditorFeatures/Test2/Diagnostics/DiagnosticServiceTests.vb index 1f9aec9da2ced..a3394af1d062e 100644 --- a/src/EditorFeatures/Test2/Diagnostics/DiagnosticServiceTests.vb +++ b/src/EditorFeatures/Test2/Diagnostics/DiagnosticServiceTests.vb @@ -2247,62 +2247,6 @@ class C End Using End Function - - - - - Friend Async Function TestTryAppendDiagnosticsForSpanAsync(category As DiagnosticAnalyzerCategory, isSpanBasedAnalyzer As Boolean) As Task - Dim test = - - - - - - - Using workspace = TestWorkspace.CreateWorkspace(test, composition:=s_compositionWithMockDiagnosticUpdateSourceRegistrationService) - Dim solution = workspace.CurrentSolution - Dim project = solution.Projects.Single() - - ' Add analyzer - Dim analyzer = New AnalyzerWithCustomDiagnosticCategory(category) - Dim analyzerReference = New AnalyzerImageReference(ImmutableArray.Create(Of DiagnosticAnalyzer)(analyzer)) - project = project.AddAnalyzerReference(analyzerReference) - Assert.False(analyzer.ReceivedOperationCallback) - - ' Get span to analyze - Dim document = project.Documents.Single() - Dim root = Await document.GetSyntaxRootAsync(CancellationToken.None) - Dim localDecl = root.DescendantNodes().OfType(Of CodeAnalysis.CSharp.Syntax.LocalDeclarationStatementSyntax).Single() - Dim span = localDecl.Span - - Dim mefExportProvider = DirectCast(workspace.Services.HostServices, IMefHostExportProvider) - Dim diagnosticService = Assert.IsType(Of DiagnosticAnalyzerService)(workspace.GetService(Of IDiagnosticAnalyzerService)()) - Dim incrementalAnalyzer = diagnosticService.CreateIncrementalAnalyzer(workspace) - - ' Verify available diagnostic descriptors - Dim descriptorsMap = solution.SolutionState.Analyzers.GetDiagnosticDescriptorsPerReference(diagnosticService.AnalyzerInfoCache, project) - Assert.Equal(1, descriptorsMap.Count) - Dim descriptors = descriptorsMap.First().Value - Assert.Equal(1, descriptors.Length) - Assert.Equal(analyzer.Descriptor.Id, descriptors.Single().Id) - - ' Try get diagnostics for span - Await diagnosticService.TryGetDiagnosticsForSpanAsync(document, span, shouldIncludeDiagnostic:=Nothing, includeSuppressedDiagnostics:=False, - priorityProvider:=New DefaultCodeActionRequestPriorityProvider(), - DiagnosticKind.All, isExplicit:=False, CancellationToken.None) - - ' Verify only existing cached diagnostics are returned with TryAppendDiagnosticsForSpanAsync, with no analyzer callbacks being made. - Assert.False(analyzer.ReceivedOperationCallback) - End Using - End Function - Friend Async Function TestGetDiagnosticsForDiagnosticKindAsync(diagnosticKind As DiagnosticKind) As Task diff --git a/src/EditorFeatures/TestUtilities/Diagnostics/MockDiagnosticAnalyzerService.cs b/src/EditorFeatures/TestUtilities/Diagnostics/MockDiagnosticAnalyzerService.cs index 424a6876218c1..78a931c05c893 100644 --- a/src/EditorFeatures/TestUtilities/Diagnostics/MockDiagnosticAnalyzerService.cs +++ b/src/EditorFeatures/TestUtilities/Diagnostics/MockDiagnosticAnalyzerService.cs @@ -69,8 +69,5 @@ public Task> GetDiagnosticsForSpanAsync(TextDocum public Task> GetProjectDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, ImmutableHashSet? diagnosticIds, Func? shouldIncludeAnalyzer, bool includeSuppressedDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) => throw new NotImplementedException(); - - public Task<(ImmutableArray diagnostics, bool upToDate)> TryGetDiagnosticsForSpanAsync(TextDocument document, TextSpan range, Func? shouldIncludeDiagnostic, bool includeSuppressedDiagnostics, ICodeActionRequestPriorityProvider priorityProvider, DiagnosticKind diagnosticKind, bool isExplicit, CancellationToken cancellationToken) - => throw new NotImplementedException(); } } diff --git a/src/Features/Core/Portable/CodeFixes/FirstFixResult.cs b/src/Features/Core/Portable/CodeFixes/FirstFixResult.cs deleted file mode 100644 index 19f4fd158539f..0000000000000 --- a/src/Features/Core/Portable/CodeFixes/FirstFixResult.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Diagnostics.CodeAnalysis; - -namespace Microsoft.CodeAnalysis.CodeFixes; - -internal readonly struct FirstFixResult(bool upToDate, CodeFixCollection? codeFixCollection) -{ - public readonly bool UpToDate = upToDate; - public readonly CodeFixCollection? CodeFixCollection = codeFixCollection; - - [MemberNotNullWhen(true, nameof(CodeFixCollection))] - public bool HasFix => CodeFixCollection != null; -} diff --git a/src/Features/Core/Portable/Diagnostics/IDiagnosticAnalyzerService.cs b/src/Features/Core/Portable/Diagnostics/IDiagnosticAnalyzerService.cs index 34fb28f4ec7f6..40221e14df8b9 100644 --- a/src/Features/Core/Portable/Diagnostics/IDiagnosticAnalyzerService.cs +++ b/src/Features/Core/Portable/Diagnostics/IDiagnosticAnalyzerService.cs @@ -116,26 +116,6 @@ internal interface IDiagnosticAnalyzerService /// Cancellation token. Task> GetProjectDiagnosticsForIdsAsync(Solution solution, ProjectId? projectId, ImmutableHashSet? diagnosticIds, Func? shouldIncludeAnalyzer, bool includeSuppressedDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken); - /// - /// Try to return up to date diagnostics for the given span for the document. - /// - /// It will return true if it was able to return all up-to-date diagnostics. - /// otherwise, false indicating there are some missing diagnostics in the diagnostic list - /// - /// This API will only force complete analyzers that support span based analysis, i.e. compiler analyzer and - /// s that support . - /// For the rest of the analyzers, it will only return diagnostics if the analyzer has already been executed. - /// Use - /// if you want to force complete all analyzers and get up-to-date diagnostics for all analyzers for the given span. - /// - Task<(ImmutableArray diagnostics, bool upToDate)> TryGetDiagnosticsForSpanAsync( - TextDocument document, TextSpan range, Func? shouldIncludeDiagnostic, - bool includeSuppressedDiagnostics, - ICodeActionRequestPriorityProvider priorityProvider, - DiagnosticKind diagnosticKind, - bool isExplicit, - CancellationToken cancellationToken); - /// /// Return up to date diagnostics for the given span for the document /// diff --git a/src/Features/LanguageServer/Protocol/Features/CodeFixes/CodeFixService.cs b/src/Features/LanguageServer/Protocol/Features/CodeFixes/CodeFixService.cs index c67bad14168a8..97385260fca79 100644 --- a/src/Features/LanguageServer/Protocol/Features/CodeFixes/CodeFixService.cs +++ b/src/Features/LanguageServer/Protocol/Features/CodeFixes/CodeFixService.cs @@ -98,19 +98,18 @@ public CodeFixService( }; } - public async Task GetMostSevereFixAsync( + public async Task GetMostSevereFixAsync( TextDocument document, TextSpan range, ICodeActionRequestPriorityProvider priorityProvider, CodeActionOptionsProvider fallbackOptions, CancellationToken cancellationToken) { using var _ = TelemetryLogging.LogBlockTimeAggregated(FunctionId.CodeFix_Summary, $"Pri{priorityProvider.Priority.GetPriorityInt()}.{nameof(GetMostSevereFixAsync)}"); ImmutableArray allDiagnostics; - bool upToDate; using (TelemetryLogging.LogBlockTimeAggregated(FunctionId.CodeFix_Summary, $"Pri{priorityProvider.Priority.GetPriorityInt()}.{nameof(GetMostSevereFixAsync)}.{nameof(_diagnosticService.GetDiagnosticsForSpanAsync)}")) { - (allDiagnostics, upToDate) = await _diagnosticService.TryGetDiagnosticsForSpanAsync( + allDiagnostics = await _diagnosticService.GetDiagnosticsForSpanAsync( document, range, GetShouldIncludeDiagnosticPredicate(document, priorityProvider), - includeSuppressedDiagnostics: false, priorityProvider, DiagnosticKind.All, isExplicit: false, cancellationToken).ConfigureAwait(false); + includeCompilerDiagnostics: true, includeSuppressedDiagnostics: false, priorityProvider, addOperationScope: null, DiagnosticKind.All, isExplicit: false, cancellationToken).ConfigureAwait(false); } var copilotDiagnostics = await GetCopilotDiagnosticsAsync(document, range, priorityProvider.Priority, cancellationToken).ConfigureAwait(false); @@ -146,7 +145,7 @@ public async Task GetMostSevereFixAsync( await otherFixTask.ConfigureAwait(false); linkedTokenSource.Cancel(); - return new FirstFixResult(upToDate, collection); + return collection; async Task GetFirstFixAsync( SortedDictionary> spanToDiagnostics, diff --git a/src/Features/LanguageServer/Protocol/Features/CodeFixes/ICodeFixService.cs b/src/Features/LanguageServer/Protocol/Features/CodeFixes/ICodeFixService.cs index e0c55f84e1acf..ac99ada3945e5 100644 --- a/src/Features/LanguageServer/Protocol/Features/CodeFixes/ICodeFixService.cs +++ b/src/Features/LanguageServer/Protocol/Features/CodeFixes/ICodeFixService.cs @@ -23,7 +23,7 @@ internal interface ICodeFixService /// first. This will also attempt to return a fix for an error first, but will fall back to any fix if that /// does not succeed. /// - Task GetMostSevereFixAsync(TextDocument document, TextSpan range, ICodeActionRequestPriorityProvider priorityProvider, CodeActionOptionsProvider fallbackOptions, CancellationToken cancellationToken); + Task GetMostSevereFixAsync(TextDocument document, TextSpan range, ICodeActionRequestPriorityProvider priorityProvider, CodeActionOptionsProvider fallbackOptions, CancellationToken cancellationToken); Task GetDocumentFixAllForIdInSpanAsync(TextDocument document, TextSpan textSpan, string diagnosticId, DiagnosticSeverity severity, CodeActionOptionsProvider fallbackOptions, CancellationToken cancellationToken); Task ApplyCodeFixesForSpecificDiagnosticIdAsync(TDocument document, string diagnosticId, DiagnosticSeverity severity, IProgress progressTracker, CodeActionOptionsProvider fallbackOptions, CancellationToken cancellationToken) diff --git a/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService.cs b/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService.cs index 8550f899852e0..c81aac4ad8328 100644 --- a/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService.cs +++ b/src/Features/LanguageServer/Protocol/Features/Diagnostics/DiagnosticAnalyzerService.cs @@ -18,6 +18,7 @@ using Microsoft.CodeAnalysis.Shared.TestHooks; using Microsoft.CodeAnalysis.SolutionCrawler; using Microsoft.CodeAnalysis.Text; +using Microsoft.VisualStudio.Threading; using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.Diagnostics @@ -76,33 +77,7 @@ public static bool IsGlobalOptionAffectingDiagnostics(IOption2 option) public void RequestDiagnosticRefresh() => _diagnosticsRefresher?.RequestWorkspaceRefresh(); - public Task<(ImmutableArray diagnostics, bool upToDate)> TryGetDiagnosticsForSpanAsync( - TextDocument document, - TextSpan range, - Func? shouldIncludeDiagnostic, - bool includeSuppressedDiagnostics, - ICodeActionRequestPriorityProvider priorityProvider, - DiagnosticKind diagnosticKinds, - bool isExplicit, - CancellationToken cancellationToken) - { - var analyzer = CreateIncrementalAnalyzer(document.Project.Solution.Workspace); - - // always make sure that analyzer is called on background thread. - return Task.Run(async () => - { - priorityProvider ??= new DefaultCodeActionRequestPriorityProvider(); - - using var _ = ArrayBuilder.GetInstance(out var diagnostics); - var upToDate = await analyzer.TryAppendDiagnosticsForSpanAsync( - document, range, diagnostics, shouldIncludeDiagnostic, - includeSuppressedDiagnostics, true, priorityProvider, blockForData: false, - addOperationScope: null, diagnosticKinds, isExplicit, cancellationToken).ConfigureAwait(false); - return (diagnostics.ToImmutable(), upToDate); - }, cancellationToken); - } - - public Task> GetDiagnosticsForSpanAsync( + public async Task> GetDiagnosticsForSpanAsync( TextDocument document, TextSpan? range, Func? shouldIncludeDiagnostic, @@ -115,12 +90,14 @@ public Task> GetDiagnosticsForSpanAsync( CancellationToken cancellationToken) { var analyzer = CreateIncrementalAnalyzer(document.Project.Solution.Workspace); - priorityProvider ??= new DefaultCodeActionRequestPriorityProvider(); // always make sure that analyzer is called on background thread. - return Task.Run(() => analyzer.GetDiagnosticsForSpanAsync( + await TaskScheduler.Default; + priorityProvider ??= new DefaultCodeActionRequestPriorityProvider(); + + return await analyzer.GetDiagnosticsForSpanAsync( document, range, shouldIncludeDiagnostic, includeSuppressedDiagnostics, includeCompilerDiagnostics, - priorityProvider, blockForData: true, addOperationScope, diagnosticKinds, isExplicit, cancellationToken), cancellationToken); + priorityProvider, addOperationScope, diagnosticKinds, isExplicit, cancellationToken).ConfigureAwait(false); } public Task> GetCachedDiagnosticsAsync(Workspace workspace, ProjectId? projectId, DocumentId? documentId, bool includeSuppressedDiagnostics, bool includeLocalDocumentDiagnostics, bool includeNonLocalDocumentDiagnostics, CancellationToken cancellationToken) diff --git a/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_GetDiagnosticsForSpan.cs b/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_GetDiagnosticsForSpan.cs index ef77efe45ac21..e9e7e2ad55222 100644 --- a/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_GetDiagnosticsForSpan.cs +++ b/src/Features/LanguageServer/Protocol/Features/Diagnostics/EngineV2/DiagnosticIncrementalAnalyzer_GetDiagnosticsForSpan.cs @@ -23,17 +23,6 @@ namespace Microsoft.CodeAnalysis.Diagnostics.EngineV2 { internal partial class DiagnosticIncrementalAnalyzer { - public async Task TryAppendDiagnosticsForSpanAsync( - TextDocument document, TextSpan? range, ArrayBuilder result, Func? shouldIncludeDiagnostic, - bool includeSuppressedDiagnostics, bool includeCompilerDiagnostics, ICodeActionRequestPriorityProvider priorityProvider, bool blockForData, - Func? addOperationScope, DiagnosticKind diagnosticKinds, bool isExplicit, CancellationToken cancellationToken) - { - var getter = await LatestDiagnosticsForSpanGetter.CreateAsync( - this, document, range, blockForData, addOperationScope, includeSuppressedDiagnostics, includeCompilerDiagnostics, - priorityProvider, shouldIncludeDiagnostic, diagnosticKinds, isExplicit, cancellationToken).ConfigureAwait(false); - return await getter.TryGetAsync(result, cancellationToken).ConfigureAwait(false); - } - public async Task> GetDiagnosticsForSpanAsync( TextDocument document, TextSpan? range, @@ -41,18 +30,19 @@ public async Task> GetDiagnosticsForSpanAsync( bool includeSuppressedDiagnostics, bool includeCompilerDiagnostics, ICodeActionRequestPriorityProvider priorityProvider, - bool blockForData, Func? addOperationScope, DiagnosticKind diagnosticKinds, bool isExplicit, CancellationToken cancellationToken) { using var _ = ArrayBuilder.GetInstance(out var list); - var result = await TryAppendDiagnosticsForSpanAsync( - document, range, list, shouldIncludeDiagnostic, includeSuppressedDiagnostics, includeCompilerDiagnostics, - priorityProvider, blockForData, addOperationScope, diagnosticKinds, isExplicit, cancellationToken).ConfigureAwait(false); - Debug.Assert(result); - return list.ToImmutable(); + + var getter = await LatestDiagnosticsForSpanGetter.CreateAsync( + this, document, range, addOperationScope, includeSuppressedDiagnostics, includeCompilerDiagnostics, + priorityProvider, shouldIncludeDiagnostic, diagnosticKinds, isExplicit, cancellationToken).ConfigureAwait(false); + await getter.GetAsync(list, cancellationToken).ConfigureAwait(false); + + return list.ToImmutableAndClear(); } /// @@ -73,7 +63,6 @@ private sealed class LatestDiagnosticsForSpanGetter private readonly CompilationWithAnalyzers? _compilationWithAnalyzers; private readonly TextSpan? _range; - private readonly bool _blockForData; private readonly bool _includeSuppressedDiagnostics; private readonly ICodeActionRequestPriorityProvider _priorityProvider; private readonly Func? _shouldIncludeDiagnostic; @@ -90,7 +79,6 @@ public static async Task CreateAsync( DiagnosticIncrementalAnalyzer owner, TextDocument document, TextSpan? range, - bool blockForData, Func? addOperationScope, bool includeSuppressedDiagnostics, bool includeCompilerDiagnostics, @@ -114,8 +102,7 @@ public static async Task CreateAsync( range = null; // We log performance info when we are computing diagnostics for a span - // and also blocking for data, i.e. for lightbulb code path for "Ctrl + Dot" user command. - var logPerformanceInfo = range.HasValue && blockForData; + var logPerformanceInfo = range.HasValue; var compilationWithAnalyzers = await GetOrCreateCompilationWithAnalyzersAsync(document.Project, ideOptions, stateSets, includeSuppressedDiagnostics, cancellationToken).ConfigureAwait(false); // If we are computing full document diagnostics, we will attempt to perform incremental @@ -125,7 +112,7 @@ public static async Task CreateAsync( return new LatestDiagnosticsForSpanGetter( owner, compilationWithAnalyzers, document, text, stateSets, shouldIncludeDiagnostic, includeCompilerDiagnostics, - range, blockForData, addOperationScope, includeSuppressedDiagnostics, priorityProvider, + range, addOperationScope, includeSuppressedDiagnostics, priorityProvider, isExplicit, logPerformanceInfo, incrementalAnalysis, diagnosticKinds); } @@ -176,7 +163,6 @@ private LatestDiagnosticsForSpanGetter( Func? shouldIncludeDiagnostic, bool includeCompilerDiagnostics, TextSpan? range, - bool blockForData, Func? addOperationScope, bool includeSuppressedDiagnostics, ICodeActionRequestPriorityProvider priorityProvider, @@ -193,7 +179,6 @@ private LatestDiagnosticsForSpanGetter( _shouldIncludeDiagnostic = shouldIncludeDiagnostic; _includeCompilerDiagnostics = includeCompilerDiagnostics; _range = range; - _blockForData = blockForData; _addOperationScope = addOperationScope; _includeSuppressedDiagnostics = includeSuppressedDiagnostics; _priorityProvider = priorityProvider; @@ -203,12 +188,10 @@ private LatestDiagnosticsForSpanGetter( _diagnosticKind = diagnosticKind; } - public async Task TryGetAsync(ArrayBuilder list, CancellationToken cancellationToken) + public async Task GetAsync(ArrayBuilder list, CancellationToken cancellationToken) { try { - var containsFullResult = true; - // Try to get cached diagnostics, and also compute non-cached state sets that need diagnostic computation. using var _1 = ArrayBuilder.GetInstance(out var syntaxAnalyzers); @@ -259,16 +242,11 @@ public async Task TryGetAsync(ArrayBuilder list, Cancellat var existingData = state.GetAnalysisData(AnalysisKind.Semantic); if (!await TryAddCachedDocumentDiagnosticsAsync(stateSet.Analyzer, AnalysisKind.Semantic, existingData, list, cancellationToken).ConfigureAwait(false)) { - if (ShouldRunSemanticAnalysis(stateSet.Analyzer, _incrementalAnalysis, _blockForData, - semanticSpanBasedAnalyzers, semanticDocumentBasedAnalyzers, out var stateSets)) - { - stateSets.Add(new AnalyzerWithState(stateSet.Analyzer, state, existingData)); - } - else - { - Debug.Assert(!_blockForData); - containsFullResult = false; - } + var stateSets = GetSemanticAnalysisSelectedStates( + stateSet.Analyzer, _incrementalAnalysis, + semanticSpanBasedAnalyzers, semanticDocumentBasedAnalyzers); + + stateSets.Add(new AnalyzerWithState(stateSet.Analyzer, state, existingData)); } } } @@ -279,9 +257,7 @@ public async Task TryGetAsync(ArrayBuilder list, Cancellat await ComputeDocumentDiagnosticsAsync(semanticSpanBasedAnalyzers.ToImmutable(), AnalysisKind.Semantic, _range, list, _incrementalAnalysis, cancellationToken).ConfigureAwait(false); await ComputeDocumentDiagnosticsAsync(semanticDocumentBasedAnalyzers.ToImmutable(), AnalysisKind.Semantic, span: null, list, incrementalAnalysis: false, cancellationToken).ConfigureAwait(false); - // If we are blocked for data, then we should always have full result. - Debug.Assert(!_blockForData || containsFullResult); - return containsFullResult; + return; } catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, cancellationToken)) { @@ -322,38 +298,26 @@ static bool ShouldIncludeAnalyzer( return true; } - static bool ShouldRunSemanticAnalysis( + static ArrayBuilder GetSemanticAnalysisSelectedStates( DiagnosticAnalyzer analyzer, bool incrementalAnalysis, - bool blockForData, ArrayBuilder semanticSpanBasedAnalyzers, - ArrayBuilder semanticDocumentBasedAnalyzers, - [NotNullWhen(true)] out ArrayBuilder? selectedStateSets) + ArrayBuilder semanticDocumentBasedAnalyzers) { - // If the caller doesn't want us to force compute diagnostics, - // we don't run semantic analysis. - if (!blockForData) - { - selectedStateSets = null; - return false; - } - if (!incrementalAnalysis) { // For non-incremental analysis, we always attempt to compute all // analyzer diagnostics for the requested span. - selectedStateSets = semanticSpanBasedAnalyzers; + return semanticSpanBasedAnalyzers; } else { // We can perform incremental analysis only for analyzers that support // span-based semantic diagnostic analysis. - selectedStateSets = analyzer.SupportsSpanBasedSemanticDiagnosticAnalysis() + return analyzer.SupportsSpanBasedSemanticDiagnosticAnalysis() ? semanticSpanBasedAnalyzers : semanticDocumentBasedAnalyzers; } - - return true; } } diff --git a/src/VisualStudio/Core/Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb b/src/VisualStudio/Core/Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb index 18f5ba636ac94..88555e728702a 100644 --- a/src/VisualStudio/Core/Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb +++ b/src/VisualStudio/Core/Test/Diagnostics/ExternalDiagnosticUpdateSourceTests.vb @@ -339,10 +339,6 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.Diagnostics Public Function ForceAnalyzeProjectAsync(project As Project, cancellationToken As CancellationToken) As Task Implements IDiagnosticAnalyzerService.ForceAnalyzeProjectAsync Throw New NotImplementedException() End Function - - Public Function TryGetDiagnosticsForSpanAsync(document As TextDocument, range As TextSpan, shouldIncludeDiagnostic As Func(Of String, Boolean), includeSuppressedDiagnostics As Boolean, priority As ICodeActionRequestPriorityProvider, diagnosticKinds As DiagnosticKind, isExplicit As Boolean, cancellationToken As CancellationToken) As Task(Of (diagnostics As ImmutableArray(Of DiagnosticData), upToDate As Boolean)) Implements IDiagnosticAnalyzerService.TryGetDiagnosticsForSpanAsync - Return Task.FromResult((ImmutableArray(Of DiagnosticData).Empty, False)) - End Function End Class