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

multi-root workspace support, minimal patch #2117

Merged
merged 1 commit into from
Aug 7, 2018

Commits on Aug 7, 2018

  1. multi-root workspace support, minimal patch

    What is a workspace / workspace folder? It is a folder on the file system that serves as a container for:
    
    - workspace configuration: in sub-folder ".theia"
      - preferences, in ".theia/settings.json"
      - root folders list, in ".theia/roots.json"
    - optionally content in the form of other files/folders
    
    For backward compatibility and simplicity, a workspace folder that contains no explicit root folder list configuration will use its own folder as the single root. This permits using any folder as a workspace.
    If subsequently an additional root folder is added to such a workspace, then both the newly added folder and the original implicit root are added to the root folders list configuration. Either can later be removed. If all roots are removed form the configuration, the workspace falls-back to using its own folder as implicit root.
    
    This PR is the minimal patch for eclipse-theia#1660
    
    What's included in this PR:
    - a workspace's root folders list could be modified using the navigator context menu "add/remove folder" items to add or remove a folder
    - preference 'workspace.supportMultiRootWorkspace', with default value false, can be used to control if the context menu entries, used to modify the list of root folders, are shown or not. Since this is a new feature that is not supported by most Theia extensions yet, it probably makes sense to hide the UI by default for now
    - previously the "current root" was a static value, obtained by each extension that needs it, at the startup of a Theia client. To change it (e.g. to switch workspace), a restart of the client was required. For this feature we did not want to have to restart the client each time the list of root folders is updated, so we introduced a new "onWorkspaceRootChanged" event. Extensions that need to know when the list of root folders is modified can react to this event, e.g. to update their widgets. It's still necessary to reload the Theia frontend when switching workspace in a given tab or when closing a workspace.
    - the root folder list comprised of 1 to many folders can be displayed from the file navigator widget.
    - the root folders will be scanned for git repositories that the user can select, stage and commit files into.
    
    What's not included:
    - users should have the choice of naming the workspace and choosing where to store the config file
    - preference extension should be able to handle the settings from multiple projects
    - search-in-workspace and file-search extension should be able to perform the search across all folders in the workspace, and / or provide filtering mechanism to reduce the amount of information being displayed
    - output and problems widgets should display data from all root folders, and / or provide filtering mechanism to reduce the amount of information being displayed
    - task extension should be able to run tasks defined under all root folders
    - users should be able to open the terminal from any root folder in the workspace
    
    Signed-off-by: elaihau <liang.huang@ericsson.com>
    elaihau committed Aug 7, 2018
    Configuration menu
    Copy the full SHA
    1299094 View commit details
    Browse the repository at this point in the history