From 49b29b9f812b10ddb85efbf734c1d90893470582 Mon Sep 17 00:00:00 2001 From: mary-georgiou-sonarsource Date: Tue, 14 Mar 2023 15:14:59 +0100 Subject: [PATCH] apply comment --- .../AnalysisContext/SonarAnalysisContextBase.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/analyzers/src/SonarAnalyzer.Common/AnalysisContext/SonarAnalysisContextBase.cs b/analyzers/src/SonarAnalyzer.Common/AnalysisContext/SonarAnalysisContextBase.cs index d9ffe438016..7e567344947 100644 --- a/analyzers/src/SonarAnalyzer.Common/AnalysisContext/SonarAnalysisContextBase.cs +++ b/analyzers/src/SonarAnalyzer.Common/AnalysisContext/SonarAnalysisContextBase.cs @@ -127,9 +127,9 @@ public bool HasMatchingScope(DiagnosticDescriptor descriptor) private bool ShouldAnalyzeFile(SonarLintXmlReader sonarLintXml, string filePath) => ProjectConfiguration().ProjectType != ProjectType.Unknown // Not SonarLint context, NuGet or Scanner <= 5.0 - || (FileInclusionCache.GetValue(Compilation, _ => new()) is var cache - && cache.GetOrAdd(filePath, _ => sonarLintXml.IsFileIncluded(filePath, IsTestProject()))); + || FileInclusionCache.GetValue(Compilation, _ => new()).GetOrAdd(filePath, x => IsFileIncluded(sonarLintXml, x, IsTestProject())); + private bool IsFileIncluded(SonarLintXmlReader sonarLintXml, string filePath, bool v) => throw new NotImplementedException(); private ImmutableHashSet CreateUnchangedFilesHashSet() => ImmutableHashSet.Create(StringComparer.OrdinalIgnoreCase, ProjectConfiguration().AnalysisConfig?.UnchangedFiles() ?? Array.Empty()); }