Table of Contents

Class Symbol

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

The base Symbol type. All symbols must be addressable with a Uri that is unique across the workspace.

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

Remarks

The Name of a symbol is not necessarily a valid identifier value.

Constructors

Symbol(Uri, Uri, string, ScopeKind, SymbolKindExt)

The base Symbol type. All symbols must be addressable with a Uri that is unique across the workspace.

protected Symbol(Uri workspaceRoot, Uri parentUri, string name, ScopeKind scope, SymbolKindExt kind)

Parameters

workspaceRoot Uri

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

parentUri Uri

The Uri of the parent symbol (null for any top-level library/project workspace symbol).

name string

The name of the symbol.

scope ScopeKind

The allocation scope of the symbol.

kind SymbolKindExt

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

Remarks

The Name of a symbol is not necessarily a valid identifier value.

Properties

Children

An immutable array where each Uri element refers to the Uri of a child symbol.

public ImmutableArray<Uri> Children { get; init; }

Property Value

ImmutableArray<Uri>

Kind

Describes the SymbolKind, the type of symbol.

public SymbolKindExt Kind { get; init; }

Property Value

SymbolKindExt

Remarks

Serialized as a simple int; the internal model uses an extended set beyond LSP 3.17 that clients may ignore.

Name

The Name of the symbol.

public virtual string Name { get; }

Property Value

string

ParentUri

The Uri of the parent symbol.

public Uri ParentUri { get; init; }

Property Value

Uri

Remarks

⚠️ This property is actually null given a LibrarySymbol.

Properties

Gets an immutable dictionary of SymbolProperty<T> keyed by name for serialization.

public ImmutableDictionary<object, object> Properties { get; init; }

Property Value

ImmutableDictionary<object, object>

ScopeKind

Describes how the runtime manages this symbol in memory.

public ScopeKind ScopeKind { get; init; }

Property Value

ScopeKind

SymbolKind

Describes the SymbolKind, the type of symbol.

public SymbolKind SymbolKind { get; }

Property Value

SymbolKind

Remarks

Can be used by a LSP client to categorize symbols.

Uri

A Uri that uniquely identifies the symbol.

public Uri Uri { get; init; }

Property Value

Uri

WorkspaceRoot

The Uri of the parent library/project.

public Uri WorkspaceRoot { get; init; }

Property Value

Uri

Methods

GetProperty<T>(SymbolProperty<T>)

Gets the value of the specified SymbolProperty.

public T? GetProperty<T>(SymbolProperty<T> key)

Parameters

key SymbolProperty<T>

The SymbolProperty to get the value for.

Returns

T

null if the specified property is undefined for this symbol.

Type Parameters

T

Remarks

Use SymbolProperties static members to

WithChildren(IEnumerable<Uri>)

Creates a copy of this symbol having the specified Children.

public Symbol WithChildren(IEnumerable<Uri> children)

Parameters

children IEnumerable<Uri>

Returns

Symbol

With<T>(SymbolProperty<T>, T)

Creates a copy of this symbol having the specified SymbolProperty value.

public Symbol With<T>(SymbolProperty<T> key, T value)

Parameters

key SymbolProperty<T>

The SymbolProperty to affect.

value T

The value to be assigned.

Returns

Symbol

Type Parameters

T