mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
fix(36481): allow renaming private fields (#36499)
This commit is contained in:
@@ -92,6 +92,7 @@ namespace ts.Rename {
|
||||
function nodeIsEligibleForRename(node: Node): boolean {
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.Identifier:
|
||||
case SyntaxKind.PrivateIdentifier:
|
||||
case SyntaxKind.StringLiteral:
|
||||
case SyntaxKind.NoSubstitutionTemplateLiteral:
|
||||
case SyntaxKind.ThisKeyword:
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////class Foo {
|
||||
//// [|/**/#foo|] = 1;
|
||||
////
|
||||
//// getFoo() {
|
||||
//// return this.#foo;
|
||||
//// }
|
||||
////}
|
||||
|
||||
goTo.marker("");
|
||||
verify.renameInfoSucceeded("#foo");
|
||||
@@ -0,0 +1,11 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////class Foo {
|
||||
//// [|[|{| "contextRangeIndex": 0 |}#foo|] = 1;|]
|
||||
////
|
||||
//// getFoo() {
|
||||
//// return this.[|#foo|];
|
||||
//// }
|
||||
////}
|
||||
|
||||
verify.rangesWithSameTextAreRenameLocations("#foo");
|
||||
Reference in New Issue
Block a user