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

This commit is contained in:
Alexander T authored and GitHub committed 2020-01-29 09:21:19 -08:00
1 parent 6769313eee
commit 9fd0202e9f
3 files changed
+24

No files matched your search

+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");