Hi all,
I would like to open multiple folders in File Navigator view.
For example here are the folders:
/home/user1/folder1
/home/user1/folder2
/myfolder/test-folder
/anotherfolder/level1/level2
Hi all,
I would like to open multiple folders in File Navigator view.
For example here are the folders:
/home/user1/folder1
/home/user1/folder2
/myfolder/test-folder
/anotherfolder/level1/level2
You should create a workspace file and open it. See a command Add a folder to a workspace
.
My implementation is based on theia v0.8.0., sorry !
It looks like the implementation is not available in that version ?
Yes, I think so. Sorry I am not sure how you can achieve it without multi-root workspaces support. 0.8.0 sounds very old
Thank you very much !
I tried calling WorkspaceService.addRoot(folderUri)
, it seems to work.
Also, I tried opening multi-root workspace using a workspace file too. It works well !
When I open a multi-root workspace, I would like certain root nodes to show some custom text instead of folder name.
i.e., when I open a multi-root workspace now, it shows up like the tree below (the names are the actual folder names):
+ WorkspaceRootFolderName1
+ WorkspaceRootFolderName2
+ WorkspaceRootFolderName3
But, I would like to show like given below:
+ WorkspaceRootFolderName1
+ CustomNameForRootFolder2
+ CustomNameForRootFolder3
The workspace file I created had the following content:
{
"folders": [
{
"path": "file:///home/projects/WorkspaceRootFolderName1"
},
{
"path": "file:///home/projects/WorkspaceRootFolderName2",
"name": "CustomNameForRootFolder2"
},
{
"path": "file:///home/projects/WorkspaceRootFolderName3",
"name": "CustomNameForRootFolder3"
}
],
"settings": {}
}
… as I saw the following in @theia/workspace/src/browser/workspace-service.ts
:
export interface WorkspaceData {
folders: Array<{ path: string, name?: string }>;
// tslint:disable-next-line:no-any
settings?: { [id: string]: any };
}
thank you, @akosyakov
If I open a workspace using the workspace file as shown above, the workspace opens properly, but the workspace file’s name is shown in the file navigator view as the root node. How can I hide/avoid that ?