Skip to content
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

Rename fails in Untitled notebook #3276

Closed
debonte opened this issue Sep 3, 2022 · 3 comments
Closed

Rename fails in Untitled notebook #3276

debonte opened this issue Sep 3, 2022 · 3 comments
Assignees
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version

Comments

@debonte
Copy link
Contributor

debonte commented Sep 3, 2022

  • Language Server version: 2022.8.51

Code Snippet

Cell 0:

class Foo:
    pass

Cell 1:

Foo()

Repro Steps:

Scenario 1: Rename in bottom cell

  1. Use Create: New Jupyter Notebook command to create a notebook
  2. Setup cells as shown above
  3. Right-click Foo() in cell 1 and select Rename Symbol

Expected behavior

Rename experience starts.

Actual behavior

Popup error: "The element can't be renamed"

Scenario 2: Rename in top cell

  1. Right-click Foo in cell 0 and select Rename Symbol
  2. Enter new name in rename text box and press Enter

Expected behavior

Foo is renamed in both cells.

Actual behavior

Name only changes in cell 0.

Scenario 3: Rename in saved file

  1. Undo rename (Ctrl-Z)
  2. Save file
  3. Try rename again.

Result

Now you can rename in either cell and Foo in both cells is updated.

Scenario 4: Opening another Untitled notebook breaks experience again

  1. Use Create: New Jupyter Notebook command to create a second notebook
  2. Switch back to saved notebook.
  3. Now rename experience in saved notebook is broken -- same as in Scenario 1 and 2 above.

Logs

UntitledNotebookRenameLog2.txt

@debonte
Copy link
Contributor Author

debonte commented Sep 3, 2022

On my machine, when rename fails _getRenameSymbolMode is returning "none". When it succeeds (saved file), it is returning "mutliFileMode". Should it be "singleFileMode" in both cases?

@judej judej added the needs investigation Could be an issue - needs investigation label Sep 6, 2022
@rchiodo rchiodo self-assigned this Oct 26, 2022
@rchiodo
Copy link
Contributor

rchiodo commented Oct 28, 2022

This also fails in an untitled python file:

  • Create new file
  • Change language to python
  • Add this code
class Foo():
    pass

Foo()

Try to rename on the second Foo and it fails.

Root cause is untitled files are marked as untracked.

@rchiodo rchiodo removed the notebooks label Oct 28, 2022
@judej judej assigned heejaechang and unassigned rchiodo Nov 1, 2022
@heejaechang heejaechang added fixed in next version (main) A fix has been implemented and will appear in an upcoming version and removed needs investigation Could be an issue - needs investigation labels Nov 3, 2022
@rchiodo rchiodo closed this as completed Nov 10, 2022
@rchiodo
Copy link
Contributor

rchiodo commented Nov 10, 2022

This issue has been fixed in prerelease version 2022.11.21, which we've just released. You can find the changelog here: CHANGELOG.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version
Projects
None yet
Development

No branches or pull requests

4 participants