Class Symbol
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
workspaceRootUriA
Urirepresenting the absolute path to the library or project workspace.parentUriUriThe
Uriof the parent symbol (nullfor any top-level library/project workspace symbol).namestringThe name of the symbol.
scopeScopeKindThe allocation scope of the symbol.
kindSymbolKindExtA
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
Kind
Describes the SymbolKind, the type of symbol.
public SymbolKindExt Kind { get; init; }
Property Value
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
ParentUri
The Uri of the parent symbol.
public Uri ParentUri { get; init; }
Property Value
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
ScopeKind
Describes how the runtime manages this symbol in memory.
public ScopeKind ScopeKind { get; init; }
Property Value
SymbolKind
Describes the SymbolKind, the type of symbol.
public SymbolKind SymbolKind { get; }
Property Value
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
WorkspaceRoot
The Uri of the parent library/project.
public Uri WorkspaceRoot { get; init; }
Property Value
Methods
GetProperty<T>(SymbolProperty<T>)
Gets the value of the specified SymbolProperty.
public T? GetProperty<T>(SymbolProperty<T> key)
Parameters
keySymbolProperty<T>The
SymbolPropertyto get the value for.
Returns
- T
nullif 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
childrenIEnumerable<Uri>
Returns
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
keySymbolProperty<T>The
SymbolPropertyto affect.valueTThe value to be assigned.
Returns
Type Parameters
T