ts-simple-ast
Version:
TypeScript compiler wrapper for AST navigation and code generation.
28 lines (26 loc) • 712 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const Node_1 = require("./Node");
class Identifier extends Node_1.Node {
/**
* Gets the text for the identifier.
*/
getText() {
return this.compilerNode.text;
}
/**
* Renames the identifier.
* @param newName - New name of the identifier.
*/
rename(newName) {
this.global.languageService.renameNode(this, newName);
}
/**
* Finds all the references of this identifier.
*/
findReferences() {
return this.global.languageService.findReferences(this.sourceFile, this);
}
}
exports.Identifier = Identifier;
//# sourceMappingURL=Identifier.js.map