MCPcopy Index your code
hub / github.com/TruthHun/BookStack / inner

Function inner

static/editor.md/lib/codemirror/addon/tern/tern.js:371–390  ·  view source on GitHub ↗
(varName)

Source from the content-addressed store, hash-verified

369
370 function jumpToDef(ts, cm) {
371 function inner(varName) {
372 var req = {type: "definition", variable: varName || null};
373 var doc = findDoc(ts, cm.getDoc());
374 ts.server.request(buildRequest(ts, doc, req), function(error, data) {
375 if (error) return showError(ts, cm, error);
376 if (!data.file && data.url) { window.open(data.url); return; }
377
378 if (data.file) {
379 var localDoc = ts.docs[data.file], found;
380 if (localDoc && (found = findContext(localDoc.doc, data))) {
381 ts.jumpStack.push({file: doc.name,
382 start: cm.getCursor("from"),
383 end: cm.getCursor("to")});
384 moveTo(ts, doc, localDoc, found.start, found.end);
385 return;
386 }
387 }
388 showError(ts, cm, "Could not find a definition.");
389 });
390 }
391
392 if (!atInterestingExpression(cm))
393 dialog(cm, "Jump to variable", function(name) { if (name) inner(name); });

Callers 11

codemirror.min.jsFile · 0.85
buildTokenSplitSpacesFunction · 0.85
buildTokenBadBidiFunction · 0.85
codemirror.jsFile · 0.85
buildTokenSplitSpacesFunction · 0.85
buildTokenBadBidiFunction · 0.85
runmode.node.jsFile · 0.85
jumpToDefFunction · 0.85
codemirror.jsFile · 0.85
buildTokenBadBidiFunction · 0.85

Calls 5

findDocFunction · 0.85
buildRequestFunction · 0.85
findContextFunction · 0.85
moveToFunction · 0.85
showErrorFunction · 0.70

Tested by

no test coverage detected