(ts, cm)
| 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; |
no test coverage detected