MCPcopy Index your code
hub / github.com/ternjs/tern / findExprAround

Function findExprAround

lib/tern.js:872–881  ·  view source on GitHub ↗
(file, query, wide)

Source from the content-addressed store, hash-verified

870 };
871
872 function findExprAround(file, query, wide) {
873 var start = query.start && resolvePos(file, query.start), end = resolvePos(file, query.end);
874 var expr = null;
875 var around = infer.findExpressionAround(file.ast, start, end, file.scope);
876 if (around && !inBody(around.node, end) &&
877 (around.node.type == "ObjectExpression" || wide ||
878 (start == null ? end : start) - around.node.start < 20 || around.node.end - end < 20))
879 expr = around;
880 return expr;
881 }
882
883 function findExprOrThrow(file, query, wide) {
884 var expr = findExpr(file, query, wide);

Callers 2

findTypeAtFunction · 0.85
findDocsFunction · 0.85

Calls 1

inBodyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…