Table of Contents

Class WorkspaceSymbol

Namespace
RDCore.SDK.Model.Symbols.Abstract
Assembly
RDCore.SDK.dll

A Symbol that is bound to a workspace document Location.

public abstract record WorkspaceSymbol : Symbol, IEquatable<Symbol>, IEquatable<WorkspaceSymbol>
Inheritance
WorkspaceSymbol
Implements
Derived
Inherited Members

Constructors

WorkspaceSymbol(Uri, Uri, string, ScopeKind, SymbolKindExt, SourceRange, SourceRange)

A Symbol that is bound to a workspace document Location.

protected WorkspaceSymbol(Uri WorkspaceRoot, Uri ParentUri, string Name, ScopeKind Scope, SymbolKindExt Kind, SourceRange Range, SourceRange SelectionRange)

Parameters

WorkspaceRoot Uri

A Uri representing the absolute path to the library or project workspace.

ParentUri Uri

The Uri of the parent symbol.

Name string

The name of the symbol.

Scope ScopeKind

The allocation scope of this symbol.

Kind SymbolKindExt

A SymbolKind (extensible) metadata value describing the kind of symbol.

Range SourceRange

The entire document Range belonging to this symbol.

SelectionRange SourceRange

The specific document Range to highlight when this symbol is selected, usually the symbol's identifier name if applicable.

Properties

AllDefinitions

Every declaration site of this symbol: Definitions when it is populated, otherwise a single synthesized Live site over Range. Use this when a caller needs to treat single- and multi-branch symbols uniformly.

public IEnumerable<SymbolDefinition> AllDefinitions { get; }

Property Value

IEnumerable<SymbolDefinition>

Alternatives

The symbol as each other conditional-compilation branch declares it, in source order: a declaration written once per branch of a #If block may declare a different type, other parameters, another kind of procedure in each (MS-VBAL §3.4). Empty for a symbol declared once.

public ImmutableArray<WorkspaceSymbol> Alternatives { get; init; }

Property Value

ImmutableArray<WorkspaceSymbol>

Remarks

The symbol itself is what the first branch declares, whatever the constants evaluate to. Whoever knows the constants defines the one of the live branch in its place (LiveDeclaration(Func<SourcePosition, bool>)).

Definitions

Every source site where this symbol is declared, in source order: populated only when the same name is declared in more than one conditional-compilation branch. Empty for the common single-declaration case, in which Range and SelectionRange are the sole site.

public ImmutableArray<SymbolDefinition> Definitions { get; init; }

Property Value

ImmutableArray<SymbolDefinition>

PrimaryRange

The primary declaration span: the first Live site, else the first site, else Range. LSP navigation targets the primary; when no precompiler-evaluation pass has run yet this is simply the first branch.

public SourceRange PrimaryRange { get; }

Property Value

SourceRange

PrimarySelectionRange

The primary selection span, chosen the same way as PrimaryRange.

public SourceRange PrimarySelectionRange { get; }

Property Value

SourceRange

Range

The entire document Range belonging to this symbol.

public SourceRange Range { get; init; }

Property Value

SourceRange

Scope

The allocation scope of this symbol.

public ScopeKind Scope { get; init; }

Property Value

ScopeKind

SelectionRange

The specific document Range to highlight when this symbol is selected, usually the symbol's identifier name if applicable.

public SourceRange SelectionRange { get; init; }

Property Value

SourceRange

Methods

LiveDeclaration(Func<SourcePosition, bool>)

The declaration of the live branch, of this symbol and its Alternatives: the first whose site is in no dead range of the module, with every site of Definitions marked live or dead; null when every site is in a dead range, and the symbol is not declared.

public WorkspaceSymbol? LiveDeclaration(Func<SourcePosition, bool> isDead)

Parameters

isDead Func<SourcePosition, bool>

Whether a position is in a branch the constants make dead.

Returns

WorkspaceSymbol