Table of Contents

Class SemanticContextBuilder<TContext, TFlags>

Namespace
RDCore.SDK.Semantics.Builders
Assembly
RDCore.SDK.dll

Builds an immutable SemanticContext encapsulating the context of a semantic operation.

public sealed record SemanticContextBuilder<TContext, TFlags> : SemanticContextFlagsBuilder<TContext, TFlags>, ISemanticContextFlagsBuilder<TContext, TFlags>, IEquatable<SemanticContextFlagsBuilder<TContext, TFlags>>, ISemanticContextBuilder<TContext, TFlags>, ISemanticContextAccumulator<TFlags>, ISemanticFlagsAccumulator<TFlags>, IEquatable<SemanticContextBuilder<TContext, TFlags>> where TContext : SemanticContext<TFlags>, new() where TFlags : struct, Enum

Type Parameters

TContext

The type of SemanticContext to build.

TFlags

A [Flags] enum type with bit-shifted members that can be composed to encode the semantic flags of the context.

Inheritance
SemanticContextFlagsBuilder<TContext, TFlags>
SemanticContextBuilder<TContext, TFlags>
Implements
ISemanticContextBuilder<TContext, TFlags>
Inherited Members

Constructors

SemanticContextBuilder(ICoreDiagnosticsFactory)

Builds an immutable SemanticContext encapsulating the context of a semantic operation.

public SemanticContextBuilder(ICoreDiagnosticsFactory CoreDiagnostics)

Parameters

CoreDiagnostics ICoreDiagnosticsFactory

Properties

CoreDiagnostics

public ICoreDiagnosticsFactory CoreDiagnostics { get; init; }

Property Value

ICoreDiagnosticsFactory

Methods

AddDiagnostic(Diagnostic)

Adds the specified Diagnostic to the semantic context.

public ISemanticContextAccumulator<TFlags> AddDiagnostic(Diagnostic diagnostic)

Parameters

diagnostic Diagnostic

The LSP Diagnostic to include in the operation's semantic context.

Returns

ISemanticContextAccumulator<TFlags>

AddDiagnosticOnError(VBApplicationErrorInfo?)

Creates and adds a new Diagnostic to the context from the specified VBApplicationErrorInfo.

public ISemanticContextAccumulator<TFlags> AddDiagnosticOnError(VBApplicationErrorInfo? applicationError)

Parameters

applicationError VBApplicationErrorInfo

Returns

ISemanticContextAccumulator<TFlags>

Remarks

Does nothing given a null reference.

AddDiagnosticOnError(VBCompileErrorInfo?)

Creates and adds a new Diagnostic to the context from the specified VBCompileErrorInfo.

public ISemanticContextAccumulator<TFlags> AddDiagnosticOnError(VBCompileErrorInfo? compileError)

Parameters

compileError VBCompileErrorInfo

The VBCompileErrorInfo (static semantics) compile-time error metadata.

Returns

ISemanticContextAccumulator<TFlags>

Remarks

Does nothing given a null reference.

AddDiagnosticOnError(VBRuntimeErrorInfo?)

Creates and adds a new Diagnostic to the context from the specified VBRuntimeErrorInfo.

public ISemanticContextAccumulator<TFlags> AddDiagnosticOnError(VBRuntimeErrorInfo? runtimeError)

Parameters

runtimeError VBRuntimeErrorInfo

The VBRuntimeErrorInfo (runtime semantics) run-time error metadata.

Returns

ISemanticContextAccumulator<TFlags>

Remarks

Does nothing given a null reference.

AddDiagnosticOnError(VBSyntaxErrorInfo?)

Creates and adds a new Diagnostic to the context from the specified VBSyntaxErrorInfo.

public ISemanticContextAccumulator<TFlags> AddDiagnosticOnError(VBSyntaxErrorInfo? syntaxError)

Parameters

syntaxError VBSyntaxErrorInfo

The VBSyntaxErrorInfo (static token semantics) compile-time error metadata.

Returns

ISemanticContextAccumulator<TFlags>

Remarks

Does nothing given a null reference.

AddDiagnosticsOnError(IEnumerable<VBApplicationErrorInfo?>)

Creates and adds a new Diagnostic to the context for each supplied non-null error info.

public ISemanticContextAccumulator<TFlags> AddDiagnosticsOnError(IEnumerable<VBApplicationErrorInfo?> errors)

Parameters

errors IEnumerable<VBApplicationErrorInfo>

The VBApplicationErrorInfo (application/domain semantics) run-time error metadata.

Returns

ISemanticContextAccumulator<TFlags>

AddDiagnosticsOnError(IEnumerable<VBCompileErrorInfo?>)

Creates and adds a new Diagnostic to the context for each supplied non-null error info.

public ISemanticContextAccumulator<TFlags> AddDiagnosticsOnError(IEnumerable<VBCompileErrorInfo?> errors)

Parameters

errors IEnumerable<VBCompileErrorInfo>

The VBCompileErrorInfo (symbol static semantics) compile-time error metadata.

Returns

ISemanticContextAccumulator<TFlags>

AddDiagnosticsOnError(IEnumerable<VBRuntimeErrorInfo?>)

Creates and adds a new Diagnostic to the context for each supplied non-null error info.

public ISemanticContextAccumulator<TFlags> AddDiagnosticsOnError(IEnumerable<VBRuntimeErrorInfo?> errors)

Parameters

errors IEnumerable<VBRuntimeErrorInfo>

The VBRuntimeErrorInfo (symbol runtime semantics) run-time error metadata.

Returns

ISemanticContextAccumulator<TFlags>

AddDiagnosticsOnError(IEnumerable<VBSyntaxErrorInfo?>)

Creates and adds a new Diagnostic to the context for each supplied non-null error info.

public ISemanticContextAccumulator<TFlags> AddDiagnosticsOnError(IEnumerable<VBSyntaxErrorInfo?> errors)

Parameters

errors IEnumerable<VBSyntaxErrorInfo>

The VBSyntaxErrorInfo (token static semantics) compile-time error metadata.

Returns

ISemanticContextAccumulator<TFlags>

AddErrorInfo<TError>(TError)

public ISemanticContextFlagsBuilder<TContext, TFlags> AddErrorInfo<TError>(TError error) where TError : VBErrorInfo

Parameters

error TError

Returns

ISemanticContextFlagsBuilder<TContext, TFlags>

Type Parameters

TError

Build()

Builds and returns an immutable SemanticContext instance from the current builder state.

public override TContext Build()

Returns

TContext