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

Function showContextInfo

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

Source from the content-addressed store, hash-verified

249 // Type queries
250
251 function showContextInfo(ts, cm, pos, queryName, c) {
252 ts.request(cm, queryName, function(error, data) {
253 if (error) return showError(ts, cm, error);
254 if (ts.options.typeTip) {
255 var tip = ts.options.typeTip(data);
256 } else {
257 var tip = elt("span", null, elt("strong", null, data.type || "not found"));
258 if (data.doc)
259 tip.appendChild(document.createTextNode(" — " + data.doc));
260 if (data.url) {
261 tip.appendChild(document.createTextNode(" "));
262 var child = tip.appendChild(elt("a", null, "[docs]"));
263 child.href = data.url;
264 child.target = "_blank";
265 }
266 }
267 tempTooltip(cm, tip);
268 if (c) c();
269 }, pos);
270 }
271
272 // Maintaining argument hints
273

Callers 1

tern.jsFile · 0.85

Calls 4

tempTooltipFunction · 0.85
showErrorFunction · 0.70
eltFunction · 0.70
cFunction · 0.50

Tested by

no test coverage detected