fix(36481): allow renaming private fields (#36499)

This commit is contained in:
Alexander T
2020-01-29 09:21:19 -08:00
committed by GitHub
parent 6769313eee
commit 9fd0202e9f
3 changed files with 24 additions and 0 deletions
+1
View File
@@ -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");