Interface IModuleAnalyzer
- Namespace
- RDCore.SDK.Extensibility.Diagnostics
- Assembly
- RDCore.SDK.dll
Looks at a module and says what is worth saying about it (RD-VBAL §2.6.4).
public interface IModuleAnalyzer
Remarks
Implement this in an extension to add a diagnostic: the platform calls every analyzer it knows of for each document it diagnoses. An analyzer is a pure function of the ModuleAnalysisContext: it does not evaluate code, and it does not resolve names - what resolving found out is among the facts it is given. The analyzers of an extension are run with ModuleAnalyzerHost.
Properties
Codes
The codes of every diagnostic the analyzer reports: an analyzer whose every code is disabled for a document is not run for it.
IReadOnlyList<RDCoreDiagnosticCode> Codes { get; }
Property Value
Remarks
An analyzer that reports several codes is run while any of them is enabled, and asks of each before it does the work of finding it (IsEnabled(RDCoreDiagnosticCode)). An analyzer may report several codes, or each code may have an analyzer of its own.
Phase
The phase in which the analyzer is asked: the earliest that has everything it reads (AnalysisPhase).
AnalysisPhase Phase { get; }
Property Value
Remarks
An analyzer that reads the syntax tree, or the facts of the static pass, is asked as soon as they are there and is not kept waiting for slower facts. One that reads Runtime overrides this to say so.
Methods
Analyze(ModuleAnalysisContext)
What the analyzer has to say about the module.
IEnumerable<AnalyzerFinding> Analyze(ModuleAnalysisContext context)
Parameters
contextModuleAnalysisContextThe module, and what is known of it.
Returns
- IEnumerable<AnalyzerFinding>
Every finding, in no particular order; none when there is nothing to say.