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

Function rename

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

Source from the content-addressed store, hash-verified

449 // Variable renaming
450
451 function rename(ts, cm) {
452 var token = cm.getTokenAt(cm.getCursor());
453 if (!/\w/.test(token.string)) return showError(ts, cm, "Not at a variable");
454 dialog(cm, "New name for " + token.string, function(newName) {
455 ts.request(cm, {type: "rename", newName: newName, fullDocs: true}, function(error, data) {
456 if (error) return showError(ts, cm, error);
457 applyChanges(ts, data.changes);
458 });
459 });
460 }
461
462 function selectName(ts, cm) {
463 var name = findDoc(ts, cm.doc).name;

Callers 1

tern.jsFile · 0.85

Calls 3

applyChangesFunction · 0.85
showErrorFunction · 0.70
dialogFunction · 0.70

Tested by

no test coverage detected