MCPcopy Index your code
hub / github.com/nodejs/node / getDefinitionAndBoundSpan

Function getDefinitionAndBoundSpan

test/fixtures/snapshot/typescript.js:139910–139925  ·  view source on GitHub ↗
(program, sourceFile, position)

Source from the content-addressed store, hash-verified

139908 return undefined;
139909 }
139910 function getDefinitionAndBoundSpan(program, sourceFile, position) {
139911 var definitions = getDefinitionAtPosition(program, sourceFile, position);
139912 if (!definitions || definitions.length === 0) {
139913 return undefined;
139914 }
139915 // Check if position is on triple slash reference.
139916 var comment = findReferenceInPosition(sourceFile.referencedFiles, position) ||
139917 findReferenceInPosition(sourceFile.typeReferenceDirectives, position) ||
139918 findReferenceInPosition(sourceFile.libReferenceDirectives, position);
139919 if (comment) {
139920 return { definitions: definitions, textSpan: ts.createTextSpanFromRange(comment) };
139921 }
139922 var node = ts.getTouchingPropertyName(sourceFile, position);
139923 var textSpan = ts.createTextSpan(node.getStart(), node.getWidth());
139924 return { definitions: definitions, textSpan: textSpan };
139925 }
139926 GoToDefinition.getDefinitionAndBoundSpan = getDefinitionAndBoundSpan;
139927 // At 'x.foo', see if the type of 'x' has an index signature, and if so find its declarations.
139928 function getDefinitionInfoForIndexSignatures(node, checker) {

Callers

nothing calls this directly

Calls 5

getDefinitionAtPositionFunction · 0.85
findReferenceInPositionFunction · 0.85
synchronizeHostDataFunction · 0.85
getValidSourceFileFunction · 0.85
getWidthMethod · 0.45

Tested by

no test coverage detected