Table of Contents

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

analyzers IEnumerable<IModuleAnalyzer>

The analyzers of the extension.

payload DiagnoseDocumentPayload

What the language server sent of the document.

logger ILogger

Where 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

analyzers IEnumerable<IModuleAnalyzer>

The analyzers of the extension.

context ModuleAnalysisContext

The module, what is known of it, and the codes that are disabled for it.

phase AnalysisPhase

The phase asked for: an analyzer is run when it includes the analyzer's own.

logger ILogger

Where 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

analyzer IModuleAnalyzer

The analyzer.

context ModuleAnalysisContext

The module, and the codes that are disabled for it.

Returns

bool