Class Resolver
Package: grammarkdown
Constructors
constructor(bindings, lineOffsetMap)
Constructs a new instance of the Resolver
class
Declaration
constructor(bindings: BindingTable, lineOffsetMap?: LineOffsetMap);
Parameters
- bindings
- BindingTable
- lineOffsetMap
- LineOffsetMap
Properties
bindings
Declaration
readonly bindings: BindingTable;
Property Value
Methods
createNavigator(node)
Creates a NodeNavigator
pointing at node
. Returns undefined
if node
does not have a SourceFile
as an ancestor.
Declaration
createNavigator(node: Node): NodeNavigator | undefined;
Parameters
- node
- Node
Returns
getDeclarations(node)
Gets the declarations for the provided identifier.
Declaration
getDeclarations(node: Identifier): Declaration[];
Parameters
- node
- Identifier
Returns
getDeclarations(name, meaning, location)
Gets the declarations for name
at the provided location
that have the given meaning
.
Declaration
getDeclarations(name: string, meaning: SymbolKind.SourceFile, location: Node): SourceFile[];
Parameters
Returns
getDeclarations(name, meaning, location)
Gets the declarations for name
at the provided location
that have the given meaning
.
Declaration
getDeclarations(name: string, meaning: SymbolKind.Production, location: Node): Production[];
Parameters
Returns
getDeclarations(name, meaning, location)
Gets the declarations for name
at the provided location
that have the given meaning
.
Declaration
getDeclarations(name: string, meaning: SymbolKind.Parameter, location: Node): Parameter[];
Parameters
Returns
getDeclarations(name, meaning, location)
Gets the declarations for name
at the provided location
that have the given meaning
.
Declaration
getDeclarations(name: string, meaning: SymbolKind, location: Node): Declaration[];
Parameters
Returns
getEffectiveFilenameAtPosition(sourceFile, position)
Gets the effective filename of a raw position within a source file, taking into account @line
directives.
Declaration
getEffectiveFilenameAtPosition(sourceFile: SourceFile, position: Position): string;
Parameters
- sourceFile
- SourceFile
- position
- Position
Returns
getEffectivePosition(sourceFile, position)
Gets the effective position of a raw position within a source file, taking into account @line
directives.
Declaration
getEffectivePosition(sourceFile: SourceFile, position: Position): Position;
Parameters
- sourceFile
- SourceFile
- position
- Position
Returns
getEffectiveRange(sourceFile, range)
Gets the effective range of a raw range within a source file, taking into account @line
directives.
Declaration
getEffectiveRange(sourceFile: SourceFile, range: Range): Range;
Parameters
- sourceFile
- SourceFile
- range
- Range
Returns
getParent(node)
Gets the parent Node
for node
.
Declaration
getParent(node: Node): Node | undefined;
Parameters
- node
- Node
Returns
getProductionLinkId(node)
Get the link id for the Production
to which the provided node
resolves.
Declaration
getProductionLinkId(node: Identifier): string | undefined;
Parameters
- node
- Identifier
Returns
getRawFilenameAtEffectivePosition(filename, position)
Gets the filename of a parsed grammarkdown file for the provided effective filename and position, taking into account @line
directives.
Declaration
getRawFilenameAtEffectivePosition(filename: string, position: Position): string | undefined;
Parameters
- filename
- string
- position
- Position
Returns
getRawPositionFromEffectivePosition(filename, position)
Gets the position in a parsed grammarkdown file for the provided effective filename and position, taking into account @line
directives.
Declaration
getRawPositionFromEffectivePosition(filename: string, position: Position): Position | undefined;
Parameters
- filename
- string
- position
- Position
Returns
getRawRangeFromEffectiveRange(filename, range)
Gets the range in a parsed grammarkdown file for the provided effective filename and position, taking into account @line
directives.
Declaration
getRawRangeFromEffectiveRange(filename: string, range: Range): Range | undefined;
Parameters
- filename
- string
- range
- Range
Returns
getReferences(node)
Gets the references to the provided identifier.
Declaration
getReferences(node: Identifier): Node[];
Parameters
- node
- Identifier
Returns
getReferences(name, meaning, location)
Gets the references to name
at the provided location
that have the given meaning
.
Declaration
getReferences(name: string, meaning: SymbolKind, location: Node): Node[];
Parameters
Returns
getRightHandSideLinkId(node, includePrefix)
Gets the right-hand-side link id for the provided RightHandSide
.
Declaration
getRightHandSideLinkId(node: RightHandSide, includePrefix: boolean): string;
Parameters
- node
- RightHandSide
- includePrefix
- boolean
When true
, prepends the production link id.
Returns
getSourceFileOfNode(node)
Gets the SourceFile
of node
, if it belongs to one.
Declaration
getSourceFileOfNode(node: Node): SourceFile | undefined;
Parameters
- node
- Node
Returns
getSymbolOfNode(node)
Gets the Symbol
for node
, if it has one.
Declaration
getSymbolOfNode(node: Node | undefined): Symbol | undefined;
Parameters
- node
- Node | undefined
Returns
resolveSymbol(location, name, meaning)
Resolves a Symbol
for the provided name
at the given location
that has the provided meaning
.
Declaration
resolveSymbol(location: Node, name: string, meaning: SymbolKind): Symbol | undefined;
Parameters
Returns