* Removes the text of an AST node from a file. * @param node Node whose text should be removed. * @param useFullOffsets Whether to remove the node using its full offset (e.g. `getFullStart` * rather than `fullStart`). This has the advantage of removing any comments that may be tied * to
(node: ts.Node, useFullOffsets = false)
| 102 | * to the node, but can lead to too much code being deleted. |
| 103 | */ |
| 104 | removeNode(node: ts.Node, useFullOffsets = false): void { |
| 105 | this._trackChange(node.getSourceFile(), { |
| 106 | start: useFullOffsets ? node.getFullStart() : node.getStart(), |
| 107 | removeLength: useFullOffsets ? node.getFullWidth() : node.getWidth(), |
| 108 | text: '', |
| 109 | }); |
| 110 | } |
| 111 | |
| 112 | /** |
| 113 | * Adds an import to a file. |
no test coverage detected