Class ModuleAnalyzerHost
- Namespace
- RDCore.SDK.Extensibility.Diagnostics
- Assembly
- RDCore.SDK.dll
Runs the analyzers of an extension over a document, as the platform runs them for every extension: those of the phase asked for, and only those that report a code that is not disabled for the document.
public static class ModuleAnalyzerHost
- Inheritance
-
ModuleAnalyzerHost
- Inherited Members
Remarks
An analyzer is run when the phase asked for includes its own (Phase), and when any of its codes is enabled (Codes, IsEnabled(RDCoreDiagnosticCode)): one whose every code is disabled is not run. An analyzer that declares no code is always run.
An analyzer that is run is told which of its codes are disabled, and skips their work. A finding of a disabled code that it reports anyway is dropped, and the analyzer is named in a warning: what is disabled is never reported, whatever an analyzer does. A finding of a code the analyzer does not declare is reported, and the analyzer named in a warning: its codes say when it is run. An analyzer that fails is named in a warning too, none of its findings is kept, and the others' are.
Methods
Run(IEnumerable<IModuleAnalyzer>, DiagnoseDocumentPayload, ILogger)
Runs the analyzers over the document of a rdcore/diagnostics/document request, in the phase it asks for, with the codes it says are disabled.
public static IReadOnlyList<AnalyzerFinding> Run(IEnumerable<IModuleAnalyzer> analyzers, DiagnoseDocumentPayload payload, ILogger logger)
Parameters
analyzersIEnumerable<IModuleAnalyzer>The analyzers of the extension.
payloadDiagnoseDocumentPayloadWhat the language server sent of the document.
loggerILoggerWhere an analyzer that fails, or that reports a disabled code, is named.
Returns
- IReadOnlyList<AnalyzerFinding>
The findings of every analyzer that was run, in the order of the analyzers.
Run(IEnumerable<IModuleAnalyzer>, ModuleAnalysisContext, AnalysisPhase, ILogger)
Runs the analyzers of a phase over a module.
public static IReadOnlyList<AnalyzerFinding> Run(IEnumerable<IModuleAnalyzer> analyzers, ModuleAnalysisContext context, AnalysisPhase phase, ILogger logger)
Parameters
analyzersIEnumerable<IModuleAnalyzer>The analyzers of the extension.
contextModuleAnalysisContextThe module, what is known of it, and the codes that are disabled for it.
phaseAnalysisPhaseThe phase asked for: an analyzer is run when it includes the analyzer's own.
loggerILoggerWhere an analyzer that fails, or that reports a disabled code, is named.
Returns
- IReadOnlyList<AnalyzerFinding>
The findings of every analyzer that was run, in the order of the analyzers.
ShouldRun(IModuleAnalyzer, ModuleAnalysisContext)
Whether an analyzer is run for a module: it declares no code, or any of its codes is enabled.
public static bool ShouldRun(IModuleAnalyzer analyzer, ModuleAnalysisContext context)
Parameters
analyzerIModuleAnalyzerThe analyzer.
contextModuleAnalysisContextThe module, and the codes that are disabled for it.