Skip to content

Commit 5c8f016

Browse files
Simplify code that was always using a constant. (#79801)
2 parents 93efd6d + 4a911a9 commit 5c8f016

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/VisualStudio/Core/Impl/SolutionExplorer/DiagnosticItem/BaseDiagnosticAndGeneratorItemSource.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ private async ValueTask ProcessQueueAsync(CancellationToken cancellationToken)
115115
return;
116116
}
117117

118-
// Currently only project analyzers show in Solution Explorer, so isHostAnalyzer is always false.
119-
var newDiagnosticItems = GenerateDiagnosticItems(project, analyzerReference, isHostAnalyzer: false);
118+
var newDiagnosticItems = GenerateDiagnosticItems(project, analyzerReference);
120119
var newSourceGeneratorItems = await GenerateSourceGeneratorItemsAsync(
121120
project, analyzerReference).ConfigureAwait(false);
122121

@@ -143,8 +142,7 @@ private async ValueTask ProcessQueueAsync(CancellationToken cancellationToken)
143142

144143
ImmutableArray<BaseItem> GenerateDiagnosticItems(
145144
Project project,
146-
AnalyzerReference analyzerReference,
147-
bool isHostAnalyzer)
145+
AnalyzerReference analyzerReference)
148146
{
149147
var generalDiagnosticOption = project.CompilationOptions!.GeneralDiagnosticOption;
150148
var specificDiagnosticOptions = project.CompilationOptions!.SpecificDiagnosticOptions;
@@ -160,7 +158,7 @@ ImmutableArray<BaseItem> GenerateDiagnosticItems(
160158
var selectedDiagnostic = g.OrderBy(d => d, s_comparer).First();
161159
var effectiveSeverity = selectedDiagnostic.GetEffectiveSeverity(
162160
project.CompilationOptions!,
163-
isHostAnalyzer ? analyzerConfigOptions?.ConfigOptionsWithFallback : analyzerConfigOptions?.ConfigOptionsWithoutFallback,
161+
analyzerConfigOptions?.ConfigOptionsWithoutFallback,
164162
analyzerConfigOptions?.TreeOptions);
165163
return (BaseItem)new DiagnosticItem(project.Id, analyzerReference, selectedDiagnostic, effectiveSeverity, CommandHandler);
166164
});

0 commit comments

Comments
 (0)