Skip to content

Renaming works weirdly for disposable types #15721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
psfinaki opened this issue Aug 1, 2023 · 12 comments · Fixed by #15884
Open

Renaming works weirdly for disposable types #15721

psfinaki opened this issue Aug 1, 2023 · 12 comments · Fixed by #15884
Assignees
Labels
Area-LangService-RenameSymbol FCS and VS support for renaming symbols Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.
Milestone

Comments

@psfinaki
Copy link
Member

psfinaki commented Aug 1, 2023

Probably two bugs here:

  1. Renaming doesn't work when there is a warning (it should though)
  2. Renaming doesn't work immediately
bug.mp4

Note I am not explicitly saving the document on-the-go.

@psfinaki
Copy link
Member Author

psfinaki commented Aug 1, 2023

@0101 do we have some tracking ticket for renaming/references? Anyway, maybe you've seen this before.

@0101
Copy link
Contributor

0101 commented Aug 1, 2023

@0101 do we have some tracking ticket for renaming/references? Anyway, maybe you've seen this before.

We don't, just the label. Actually two of them, which I think maybe we should unify as there's a huge overlap - RenameSymbol and FindAllReferences.

I haven't seen this particular issue(s) before. It looks pretty bad!

@0101 0101 added the Area-LangService-RenameSymbol FCS and VS support for renaming symbols label Aug 1, 2023
@0101 0101 added Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code. and removed Needs-Triage labels Aug 14, 2023
@0101 0101 self-assigned this Aug 28, 2023
@github-project-automation github-project-automation bot moved this from Not Planned to Done in F# Compiler and Tooling Aug 30, 2023
@0101 0101 modified the milestones: Backlog, August-2023 Sep 7, 2023
@psfinaki
Copy link
Member Author

psfinaki commented Oct 17, 2023

=@0101 has this broken again?

renamebug.mp4

@psfinaki psfinaki reopened this Oct 17, 2023
@github-project-automation github-project-automation bot moved this from Done to In Progress in F# Compiler and Tooling Oct 17, 2023
@0101
Copy link
Contributor

0101 commented Oct 18, 2023

@psfinaki looks like it. Must be for a different reason though. Which version did you see that on?

@psfinaki
Copy link
Member Author

Latest and greatest. Like, a couple days old Int Preview.

@vzarytovskii
Copy link
Member

It looks like when submitted (i.e. we commit the rename operation), it gets cancelled immediately.

@0101
Copy link
Contributor

0101 commented Oct 23, 2023

I cannot reproduce it exactly on latest main.

But what I can see is that first rename works, but after that's applied, it stops finding references to that symbol - which leads to the behavior displayed here.

Editing the file, or finding references to another symbol in that file fixes it.

So seems like rename application somehow doesn't regenerate itemKeyStore and so it doesn't contain the new name.

@psfinaki if you can try this again, what happens when you give that dialogue a bit of time to show how many occurrences it's going to rename? For me it shows almost instantly - either 2 reference in 1 file and then it works, or, 0 references in 0 files and then it doesn't.

@0101
Copy link
Contributor

0101 commented Oct 23, 2023

Update, the issue only manifests itself with Live Buffers turned off - and they did turn off for me inexplicably, which is also suspicious. Same with Cache parsing results and Keep all background symbol uses. Potentially might be related to the VS settings new UI.

With my usual configuration and all those things turned on, I cannot reproduce any renaming issues with this code.

@psfinaki
Copy link
Member Author

@0101 so I am on the latest main and here is another fun discovery: looks like the renaming works when applied to the definition and doesn't work when applied to the application. Doesn't work as in - broken already at the phase of reference discovery (as you specify in the comment). Take a look:

Recording.2023-10-24.124133.mp4

@0101
Copy link
Contributor

0101 commented Oct 24, 2023

Interesting. I cannot reproduce that (past what I could previously).

@psfinaki can you post screenshots of your settings? F# Advanced and Performance.

@psfinaki
Copy link
Member Author

There you gooo.

image
image

Live buffers don't anyhow influence this behavior - this reproduces with them on.

@0101
Copy link
Contributor

0101 commented Oct 24, 2023

Weird, can't reproduce it with exactly those settings with an extension built from our main yesterday. Only the bug with live buffers off renaming the same symbol twice. Wonder if you (or I) got some experimental VS setting that messes with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-LangService-RenameSymbol FCS and VS support for renaming symbols Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants