MCPcopy Create free account
hub / github.com/angular/angular / removeNode

Method removeNode

packages/core/schematics/utils/change_tracker.ts:104–110  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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.

Callers 7

_recordImportsMethod · 0.95
pruneNgModulesFunction · 0.95
migrateRoutesArrayFunction · 0.45
migrateClassFunction · 0.45
applyInternalOnlyChangesFunction · 0.45
removeImportReferencesFunction · 0.45
removeExportReferencesFunction · 0.45

Calls 2

_trackChangeMethod · 0.95
getSourceFileMethod · 0.45

Tested by

no test coverage detected