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

Function findTypeAt

lib/tern.js:947–969  ·  view source on GitHub ↗
(srv, query, file)

Source from the content-addressed store, hash-verified

945 }
946
947 function findTypeAt(srv, query, file) {
948 var type, exprName, exprType;
949 var expr = findExpr(file, query);
950 var typeResult = findTypeAtExpr(srv, query, file, expr);
951 type = typeResult[0];
952 if (!type) {
953 expr = findExprAround(file, query);
954 typeResult = findTypeAtExpr(srv, query, file, expr);
955 type = typeResult[0];
956 }
957 exprName = typeResult[1];
958 exprType = typeResult[2];
959
960 var result = {guess: infer.didGuess(),
961 type: infer.toString(exprType, query.depth),
962 name: type && type.name,
963 exprName: exprName,
964 doc: exprType.doc,
965 url: exprType.url};
966 if (type) storeTypeDocs(query, type, result);
967
968 return clean(result);
969 }
970
971 function parseDoc(query, doc) {
972 if (!doc) return null;

Callers

nothing calls this directly

Calls 4

findTypeAtExprFunction · 0.85
findExprAroundFunction · 0.85
storeTypeDocsFunction · 0.85
cleanFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…