Class SymbolNavigation
- Namespace
- RDCore.SDK.Semantics.Refactoring
- Assembly
- RDCore.SDK.dll
Navigates from a name to what it refers to (LSP 3.17 §Goto Definition Request, §Goto Declaration Request): the name is bound the way a rename binds it (SymbolRename), so that what a navigation finds is what a rename of the name would rename.
public static class SymbolNavigation
- Inheritance
-
SymbolNavigation
- Inherited Members
Remarks
A name declared in more than one branch of an #If is defined by each branch that is compiled
(Definitions, DefinitionState); a branch whose state is not known yet is taken to be compiled. A property is
defined by each of its procedures, its Property Get, Let and Set. A module is defined by its document, and a type named in an As
clause is the type it declares. A member
that code accesses late-bound - on an Object or a Variant - is not known to refer to any symbol, and leads nowhere.
Methods
DeclarationAt(RenameContext, Uri, SourcePosition)
Where the symbol named at position of module is declared (LSP 3.17 §Goto Declaration Request):
the one place that declares it first, whichever of its definitions are compiled.
public static SymbolNavigationTarget? DeclarationAt(RenameContext context, Uri module, SourcePosition position)
Parameters
contextRenameContextThe workspace.
moduleUriThe module.
positionSourcePositionA position in the name, or at its end.
Returns
- SymbolNavigationTarget
The name and the place that declares its symbol, as the one site of Sites: the first written, of every branch of an
#Ifand every procedure of a property, so that it is the same whatever branch the precompiler compiles. null where no name is written, or where what the name refers to is not known.
DefinitionsAt(RenameContext, Uri, SourcePosition)
Where the symbol named at position of module is defined.
public static SymbolNavigationTarget? DefinitionsAt(RenameContext context, Uri module, SourcePosition position)
Parameters
contextRenameContextThe workspace.
moduleUriThe module.
positionSourcePositionA position in the name, or at its end.
Returns
- SymbolNavigationTarget
The name and the places that define its symbol; null where no name is written, or where what the name refers to is not known.
ImplementationsAt(RenameContext, Uri, SourcePosition)
Where the symbol named at position of module is implemented (LSP 3.17 §Goto Implementation
Request): for a class, each class of the workspace that implements it, at its Implements directive; for a member of a class, the procedure of
each of those classes that implements it - IShape_Area for Area of IShape (MS-VBAL §5.2.4.2).
public static SymbolNavigationTarget? ImplementationsAt(RenameContext context, Uri module, SourcePosition position)
Parameters
contextRenameContextThe workspace.
moduleUriThe module.
positionSourcePositionA position in the name, or at its end.
Returns
- SymbolNavigationTarget
The name and each place that implements its symbol; no place for a class that no class implements, or a symbol that is no class or member of one. null where no name is written, or where what the name refers to is not known.
OccurrencesAt(RenameContext, Uri, SourcePosition)
Every name that refers to the symbol named at position of module, in every module of the workspace, its
declarations included: what a rename of it renames, and each type name that names it - whichever procedure of a property it calls.
public static SymbolNavigationTarget? OccurrencesAt(RenameContext context, Uri module, SourcePosition position)
Parameters
contextRenameContextThe workspace.
moduleUriThe module.
positionSourcePositionA position in the name, or at its end.
Returns
- SymbolNavigationTarget
As ReferencesAt(RenameContext, Uri, SourcePosition, bool) answers; the procedures of a property are one symbol.
ReferencesAt(RenameContext, Uri, SourcePosition, bool)
Where the symbol named at position of module is referred to, in every module of the workspace
(LSP 3.17 §Find References Request): each name that calls it or reads it, each name that assigns it, and each type name that names it.
public static SymbolNavigationTarget? ReferencesAt(RenameContext context, Uri module, SourcePosition position, bool includeDeclaration = true)
Parameters
contextRenameContextThe workspace.
moduleUriThe module.
positionSourcePositionA position in the name, or at its end.
includeDeclarationboolWhether the names its declarations declare are references too, and the attributes of a member.
Returns
- SymbolNavigationTarget
The name and each place that refers to its symbol, as a site whose range is the name, by module and then in the order written. null where no name is written, or where what the name refers to is not known; a name whose meaning is not known where it is written is not a reference.
Remarks
Each procedure of a property is referred to by the names that call it (MS-VBAL §5.3.1.7): its Property Get by those that read
the property, its Property Let by the targets of Let-assignments, and its Property Set by the targets of Set-assignments. The procedure is
the one whose name is at position, or the one the name there calls; a rename renames all of them (OccurrencesAt(RenameContext, Uri, SourcePosition)). The
name of a function or a Property Get that its own body assigns, or reads as a simple name, is its result, and refers to no procedure
(MS-VBAL §5.6.2.1); with an argument list, it is a recursive call, and a reference.
SymbolAt(RenameContext, Uri, SourcePosition)
The symbol named at position of module, bound as a rename binds it: a value, or the type a name that means no
value names - a class that is created, a Type a variable is declared as.
public static (SourceRange Origin, Symbol Symbol)? SymbolAt(RenameContext context, Uri module, SourcePosition position)
Parameters
contextRenameContextThe workspace.
moduleUriThe module.
positionSourcePositionA position in the name, or at its end.
Returns
- (SourceRange Origin, Symbol Symbol)?
Where the name is written, and its symbol; null where no name is written, or where what it refers to is not known.
TypeDefinitionAt(RenameContext, Uri, SourcePosition)
Where the type of the symbol named at position of module is defined (LSP 3.17 §Goto Type
Definition Request): the class, Type or Enum a variable, a constant, a parameter or a function is declared as - of an array, its items'.
public static SymbolNavigationTarget? TypeDefinitionAt(RenameContext context, Uri module, SourcePosition position)
Parameters
contextRenameContextThe workspace.
moduleUriThe module.
positionSourcePositionA position in the name, or at its end.
Returns
- SymbolNavigationTarget
The name and the places that define the type, the type itself for a name that names one; no place for an intrinsic type, or a type of a library. null where no name is written, or where what the name refers to is not known.