-
-
Notifications
You must be signed in to change notification settings - Fork 388
Renaming of indirect references (RecordFieldPuns) #3013
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
refactor: remove "safe" from function names
Should we make it transitive? This might be easier at the db level, since it would just be a join of the table with itself...
The problem is that B is both a use of a name and a binding of a name. I can' think of any other instances of that... |
I think it is best not to do this in the DB. It seems like HieDB maintains the distinction between the name and the binding of the name. I do not think we want to join the table as it might be useful to keep this information. In the example above, if I query for the references of Maybe it is more accurate to say that the issue in this PR is |
…anguage-server into rename-all-at-pos
Issue
Consider this code snippet. While explaining this issue, I will refer to the occurrences of
field
on lines 3, 6, and 7 asA
,B
, andC
respectively.References between these occurrences are not transitive since
B
consists of two names (as it is punned).In this example,
A references B
andB references C
butA does not reference C
.As a consequence, trying to rename A causes only A and B to be renamed, but we also want C to be renamed.
Proposed Solution
Doing another pass of the references to find any punned names should be sufficient.
I do not think that we can have doubly-indirect references, so we should only need to do one additional pass to find the transitive closure.
Question
Are there any other cases of having multiple names at the same position that I might have not properly considered?
Closes #2970