提交 b1fcf8ff 编写于 作者: H Heejae Chang

renamed some methods

上级 8d25de9f
......@@ -59,27 +59,8 @@ public static bool IsOpenFileOnly(this DiagnosticAnalyzer analyzer, Workspace wo
return false;
}
public static bool ShouldRunForFullProject(this DiagnosticAnalyzerService service, DiagnosticAnalyzer analyzer, Project project)
public static bool HasNonHiddenDescriptor(this DiagnosticAnalyzerService service, DiagnosticAnalyzer analyzer, Project project)
{
if (analyzer.IsBuiltInAnalyzer())
{
// always return true for builtin analyzer. we can't use
// descriptor check since many builtin analyzer always return
// hidden descriptor regardless what descriptor it actually
// return on runtime. they do this so that they can control
// severity through option page rather than rule set editor.
// this is special behavior only ide analyzer can do. we hope
// once we support editorconfig fully, third party can use this
// ability as well and we can remove this kind special treatment on builtin
// analyzer.
return true;
}
if (analyzer.IsWorkspaceDiagnosticAnalyzer())
{
return true;
}
// most of analyzers, number of descriptor is quite small, so this should be cheap.
return service.GetDiagnosticDescriptors(analyzer).Any(d => d.GetEffectiveSeverity(project.CompilationOptions) != ReportDiagnostic.Hidden);
}
......
......@@ -244,10 +244,10 @@ private IEnumerable<StateSet> GetStateSetsForFullSolutionAnalysis(IEnumerable<St
// Include only one we want to run for full solution analysis.
// stateSet not included here will never be saved because result is unknown.
return stateSets.Where(s => ShouldRunForFullProject(s.Analyzer, project));
return stateSets.Where(s => IsCandidateForFullSolutionAnalysis(s.Analyzer, project));
}
private bool ShouldRunForFullProject(DiagnosticAnalyzer analyzer, Project project)
private bool IsCandidateForFullSolutionAnalysis(DiagnosticAnalyzer analyzer, Project project)
{
// PERF: Don't query descriptors for compiler analyzer, always execute it.
if (HostAnalyzerManager.IsCompilerDiagnosticAnalyzer(project.Language, analyzer))
......@@ -255,7 +255,21 @@ private bool ShouldRunForFullProject(DiagnosticAnalyzer analyzer, Project projec
return true;
}
return Owner.ShouldRunForFullProject(analyzer, project);
if (analyzer.IsBuiltInAnalyzer())
{
// always return true for builtin analyzer. we can't use
// descriptor check since many builtin analyzer always return
// hidden descriptor regardless what descriptor it actually
// return on runtime. they do this so that they can control
// severity through option page rather than rule set editor.
// this is special behavior only ide analyzer can do. we hope
// once we support editorconfig fully, third party can use this
// ability as well and we can remove this kind special treatment on builtin
// analyzer.
return true;
}
return Owner.HasNonHiddenDescriptor(analyzer, project);
}
private void RaiseProjectDiagnosticsIfNeeded(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册