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

Function rename

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

Source from the content-addressed store, hash-verified

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

Callers 1

tern.jsFile · 0.85

Calls 4

showErrorFunction · 0.85
applyChangesFunction · 0.85
dialogFunction · 0.70
testMethod · 0.45

Tested by

no test coverage detected