Skip to content

Commit 0d3494c

Browse files
SamChou19815facebook-github-bot
authored andcommitted
[flow] Allow private name rename
Summary: It has worked before, but once we added `textDocument/prepareRename` support to resolve conflict between relay and us, it was broken, because we forgot to allow rename in private names. This diff fixes it. Changelog: [ide] Support rename on private properties and methods. Reviewed By: mariusschulz Differential Revision: D77733751 fbshipit-source-id: 9e6ace76e7452de31493b781544c2c0fee99c75b
1 parent 385a293 commit 0d3494c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/services/references/prepareRenameSearcher.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ class searcher ~contains_loc =
1414
method! identifier ((loc, _) as id) =
1515
if contains_loc loc then raise (Found loc);
1616
id
17+
18+
method! private_name ((loc, _) as id) =
19+
if contains_loc loc then raise (Found loc);
20+
id
1721
end
1822

1923
let search_rename_loc ast cursor_loc =

0 commit comments

Comments
 (0)