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