Class ModuleAnalysisContext
- Namespace
- RDCore.SDK.Extensibility.Diagnostics
- Assembly
- RDCore.SDK.dll
What an analyzer is given of a module: the syntax tree, and the facts the platform's semantic analysis pass found out about it.
public sealed record ModuleAnalysisContext : IEquatable<ModuleAnalysisContext>
- Inheritance
-
ModuleAnalysisContext
- Implements
- Inherited Members
Remarks
An analyzer is a function of facts: the pass says what is (RD-VBAL §5.0.3), and the analyzer decides what is worth saying. A fact is stated only when it is true, so an analyzer can rely on one that is there and has nothing to say about one that is not.
Constructors
ModuleAnalysisContext(Uri, ModuleParseResult, ModuleSemanticsDto?)
What an analyzer is given of a module: the syntax tree, and the facts the platform's semantic analysis pass found out about it.
public ModuleAnalysisContext(Uri Document, ModuleParseResult ParseResult, ModuleSemanticsDto? Semantics)
Parameters
DocumentUriThe document being analyzed.
ParseResultModuleParseResultThe parsed module: the syntax tree, for where things are written.
SemanticsModuleSemanticsDtoWhat the environment host found out about the module, or null when it has not: it is not part of the platform, or has not loaded the module.
Remarks
An analyzer is a function of facts: the pass says what is (RD-VBAL §5.0.3), and the analyzer decides what is worth saying. A fact is stated only when it is true, so an analyzer can rely on one that is there and has nothing to say about one that is not.
Properties
DisabledCodes
The codes whose diagnostics are disabled for the document, in the platform's settings or the workspace's (Analysis.DisabledDiagnostics): an
analyzer does not report them, and skips the work of finding them (IsEnabled(RDCoreDiagnosticCode)). None, unless said otherwise.
public IReadOnlySet<RDCoreDiagnosticCode> DisabledCodes { get; init; }
Property Value
Document
The document being analyzed.
public Uri Document { get; init; }
Property Value
ParseResult
The parsed module: the syntax tree, for where things are written.
public ModuleParseResult ParseResult { get; init; }
Property Value
Semantics
What the environment host found out about the module, or null when it has not: it is not part of the platform, or has not loaded the module.
public ModuleSemanticsDto? Semantics { get; init; }
Property Value
Methods
IsEnabled(RDCoreDiagnosticCode)
Whether the diagnostics of a code are reported for the document: an analyzer that reports several codes asks of each before it does the work of finding its diagnostics. A code of the language's own errors is always reported (CanBeDisabled).
public bool IsEnabled(RDCoreDiagnosticCode code)
Parameters
codeRDCoreDiagnosticCodeThe code.
Returns
Remarks
An analyzer whose every code is disabled is not run (ModuleAnalyzerHost); a finding of a disabled code that an analyzer reports anyway is dropped.