Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,12 @@ class FindIncomingCallTreeWalker extends ParseTreeWalker {
};
} else {
const functionRange = convertOffsetsToRange(
executionNode.start,
executionNode.start + executionNode.length,
this._parseResults.tokenizerOutput.lines
);

const functionSelectionRange = convertOffsetsToRange(
executionNode.d.name.start,
executionNode.d.name.start + executionNode.d.name.length,
this._parseResults.tokenizerOutput.lines
Expand All @@ -599,7 +605,7 @@ class FindIncomingCallTreeWalker extends ParseTreeWalker {
kind: SymbolKind.Function,
uri: convertUriToLspUriString(this._program.fileSystem, this._fileUri),
range: functionRange,
selectionRange: functionRange,
selectionRange: functionSelectionRange,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,10 @@ export class ReferencesProvider {
if (node.nodeType === ParseNodeType.Name) {
return this.getDeclarationForNode(program, fileUri, node, reporter, useCase, token);
}

if (node.nodeType === ParseNodeType.Function) {
return this.getDeclarationForNode(program, fileUri, node.d.name, reporter, useCase, token);
}

// For other node types, there are no references to be found.
return undefined;
Expand Down