MCPcopy Create free account
hub / github.com/TruthHun/BookStack / showArgHints

Function showArgHints

static/editor.md/lib/codemirror/addon/tern/tern.js:316–335  ·  view source on GitHub ↗
(ts, cm, pos)

Source from the content-addressed store, hash-verified

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

Callers 1

updateArgHintsFunction · 0.85

Calls 3

closeArgHintsFunction · 0.85
makeTooltipFunction · 0.85
eltFunction · 0.70

Tested by

no test coverage detected