Class WorkspaceSymbol
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
WorkspaceRootUriA
Urirepresenting the absolute path to the library or project workspace.ParentUriUriThe
Uriof the parent symbol.NamestringThe name of the symbol.
ScopeScopeKindThe allocation scope of this symbol.
KindSymbolKindExtA
SymbolKind(extensible) metadata value describing the kind of symbol.RangeSourceRangeThe entire document
Rangebelonging to this symbol.SelectionRangeSourceRangeThe specific document
Rangeto 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
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
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
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
PrimarySelectionRange
The primary selection span, chosen the same way as PrimaryRange.
public SourceRange PrimarySelectionRange { get; }
Property Value
Range
The entire document Range belonging to this symbol.
public SourceRange Range { get; init; }
Property Value
Scope
The allocation scope of this symbol.
public ScopeKind Scope { get; init; }
Property Value
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
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
isDeadFunc<SourcePosition, bool>Whether a position is in a branch the constants make dead.