Table of Contents

Class SemanticDocumentResult

Namespace
MuLang.Compiler
Assembly
MuLang.Compiler.dll

Represents resolved semantic occurrences and diagnostics for a MuLang document.

public sealed class SemanticDocumentResult
Inheritance
SemanticDocumentResult
Inherited Members

Properties

Diagnostics

Gets the diagnostics produced while analyzing the document.

public DiagnosticCollection Diagnostics { get; }

Property Value

DiagnosticCollection

LineMap

Gets the source line map.

public TextLineMap LineMap { get; }

Property Value

TextLineMap

Occurrences

Gets the resolved semantic occurrences.

public IReadOnlyList<SemanticOccurrence> Occurrences { get; }

Property Value

IReadOnlyList<SemanticOccurrence>

SourceDocument

Gets the source document URI, when available.

public Uri? SourceDocument { get; }

Property Value

Uri

Methods

GetHighlights(int)

Gets the semantic or control-flow highlights containing an offset.

public IReadOnlyList<SemanticOccurrence> GetHighlights(int offset)

Parameters

offset int

The zero-based Unicode scalar offset.

Returns

IReadOnlyList<SemanticOccurrence>

The related occurrences in source order.

Exceptions

ArgumentOutOfRangeException

Thrown when offset is outside the source bounds.

GetOccurrence(int)

Gets the smallest semantic occurrence containing an offset.

public SemanticOccurrence? GetOccurrence(int offset)

Parameters

offset int

The zero-based Unicode scalar offset.

Returns

SemanticOccurrence

The containing occurrence, or null when no occurrence contains the offset.

Exceptions

ArgumentOutOfRangeException

Thrown when offset is outside the source bounds.

GetOccurrences(SemanticSymbolKey)

Gets all occurrences of a resolved symbol.

public IReadOnlyList<SemanticOccurrence> GetOccurrences(SemanticSymbolKey symbol)

Parameters

symbol SemanticSymbolKey

The semantic symbol identity.

Returns

IReadOnlyList<SemanticOccurrence>

The matching occurrences in source order.

Exceptions

ArgumentNullException

Thrown when symbol is null.