Skip to content

Commit

Permalink
feat: RenameLocation - Add getPrefixText() and getSuffixText()
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed May 31, 2019
1 parent 72f0e1d commit 3cb7a7f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/ts-morph.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9858,6 +9858,14 @@ export declare class ReferenceEntry extends DocumentSpan<ts.ReferenceEntry> {
* Rename location.
*/
export declare class RenameLocation extends DocumentSpan<ts.RenameLocation> {
/**
* Gets the text to insert before the rename.
*/
getPrefixText(): string | undefined;
/**
* Gets the text to insert after the rename.
*/
getSuffixText(): string | undefined;
}

/**
Expand Down
9 changes: 9 additions & 0 deletions src/compiler/tools/results/RenameLocation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,13 @@ import { DocumentSpan } from "./DocumentSpan";
* Rename location.
*/
export class RenameLocation extends DocumentSpan<ts.RenameLocation> {
/** Gets the text to insert before the rename. */
getPrefixText() {
return this._compilerObject.prefixText;
}

/** Gets the text to insert after the rename. */
getSuffixText() {
return this._compilerObject.suffixText;
}
}

0 comments on commit 3cb7a7f

Please sign in to comment.