UNPKG

ts-simple-ast

Version:

TypeScript compiler wrapper for static analysis and code manipulation.

33 lines (32 loc) 1.17 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var FileTextChanges_1 = require("./FileTextChanges"); /** * Represents a code action. */ var CodeAction = /** @class */ (function () { /** @private */ function CodeAction(context, compilerObject) { this._context = context; this._compilerObject = compilerObject; } Object.defineProperty(CodeAction.prototype, "compilerObject", { /** Gets the compiler object. */ get: function () { return this._compilerObject; }, enumerable: true, configurable: true }); /** Description of the code action. */ CodeAction.prototype.getDescription = function () { return this.compilerObject.description; }; /** Text changes to apply to each file as part of the code action. */ CodeAction.prototype.getChanges = function () { var _this = this; return this.compilerObject.changes.map(function (change) { return new FileTextChanges_1.FileTextChanges(_this._context, change); }); }; return CodeAction; }()); exports.CodeAction = CodeAction;