menu
announcement

Spectrum is now read-only. Learn more about the decision in our official announcement.

Theia

Eclipse Theia - Cloud & Desktop IDE

Channels
Team

Closing open workspace & folders

May 29, 2020 at 2:39pm

Closing open workspace & folders

May 29, 2020 at 2:39pm (Edited 2 years ago)
Hi all,
It seems like calling WorkspaceService.close() causes browser window to refresh & reload (calls reloadWindow()). Is there a way I can close the workspaces or folders without reloading the window? (i.e., the File navigator should become empty)
Will removeRoots() or spliceRoots() work ? Could you please provide examples?
Thanks in advance.

May 29, 2020 at 3:01pm
IIRC many things in various Theia platform extensions depend on the workspace being set - e.g. in some extensions nothing will be done until this happens. For these, there is no "putting the Genie back in the bottle" once the workspace becomes "un-set", hence the app reload.

June 1, 2020 at 5:02am
when i close a workspace, i would like the filenavigator to go blank without reload, but when i open a workspace, reload is fine ...

June 1, 2020 at 12:06pm
the framework uses the reload() as a way to properly set the state, initialize components correctly, and also restart plugins and language-servers. If your use-case requires removing the reload it will require additional implementation effort to also ensure the framework falls on it's feet.

June 5, 2020 at 11:23am
i would like the filenavigator to go blank (i.,e it should stop watching the current folder that is open). i'm sure the system would go to an inconsistent state, but i would like to try to see what happens.
Any ideas on how to accomplish this ?
you can try by making changes directly to the sources, or if you'd prefer you should be able to rebind the close workspace command to instead handle it differently (without the reload). I believe that you should not only close the workspace, but also make sure as to clear the widget itself as well (blank state).