MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / showArgHints

Function showArgHints

lib/web/CodeMirror/addon/tern/tern.js:319–342  ·  view source on GitHub ↗
(ts, cm, pos)

Source from the content-addressed store, hash-verified

317 }
318
319 function showArgHints(ts, cm, pos) {
320 closeArgHints(ts);
321
322 var cache = ts.cachedArgHints, tp = cache.type;
323 var tip = elt("span", cache.guess ? cls + "fhint-guess" : null,
324 elt("span", cls + "fname", cache.name), "(");
325 for (var i = 0; i < tp.args.length; ++i) {
326 if (i) tip.appendChild(document.createTextNode(", "));
327 var arg = tp.args[i];
328 tip.appendChild(elt("span", cls + "farg" + (i == pos ? " " + cls + "farg-current" : ""), arg.name || "?"));
329 if (arg.type != "?") {
330 tip.appendChild(document.createTextNode(":\u00a0"));
331 tip.appendChild(elt("span", cls + "type", arg.type));
332 }
333 }
334 tip.appendChild(document.createTextNode(tp.rettype ? ") ->\u00a0" : ")"));
335 if (tp.rettype) tip.appendChild(elt("span", cls + "type", tp.rettype));
336 var place = cm.cursorCoords(null, "page");
337 var tooltip = ts.activeArgHints = makeTooltip(place.right + 1, place.bottom, tip, cm)
338 setTimeout(function() {
339 tooltip.clear = onEditorActivity(cm, function() {
340 if (ts.activeArgHints == tooltip) closeArgHints(ts) })
341 }, 20)
342 }
343
344 function parseFnType(text) {
345 var args = [], pos = 3;

Callers 1

updateArgHintsFunction · 0.85

Calls 4

closeArgHintsFunction · 0.85
makeTooltipFunction · 0.85
onEditorActivityFunction · 0.85
eltFunction · 0.70

Tested by

no test coverage detected