Skip to content

[editor]: EditorManager#currentEditor behaves incorrectly after a file rename #12139

@kittaakos

Description

@kittaakos

Bug Description:

When I rename a file, and the Explorer view is not visible, EditorManager#currentEditor provides an incorrect result after the rename.

Steps to Reproduce:

Use the additional custom commands from my fork to reproduce the defect: master...kittaakos:theia:current-editor-after-rename

There are two commands:

  • Toast the URI of the current editor with the Ctrl/⌘+K K keychord.
  • Perform a rename of the current editor with the Ctrl/⌘+K R keychord.
  1. Open a workspace with two files: a.txt and b.txt. Toggle the Explorer view. You do not see the file tree. This is important not to involve the SelectionService.
  2. Select a.txt and use the keychord to toast the current URI. It works.
  3. Select b.txt and use the same keychord to toast the current URI. It works.
  4. When the active editor is b.txt, use the other keychord to rename the editor. Rename b.txt to c.txt. It works. The current editor in the UI is c.txt after the rename.
  5. Use the keychord to toast the current editor URI. It prints a.txt, although c.txt is the current one in the UI. It's a bug.
current_editor_bug_after_rename.mp4

Additional Information

  • Operating System:
  • Theia Version: b28c8b9

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions