mirror of
https://github.com/hexedtech/codemp-vscode.git
synced 2024-12-23 13:54:55 +01:00
feat: add label if you have no workspaces to join after you connect
This commit is contained in:
parent
2e62362ff3
commit
57fcc9ce90
1 changed files with 15 additions and 0 deletions
15
src/tree.ts
15
src/tree.ts
|
@ -21,7 +21,16 @@ export class CodempTreeProvider implements vscode.TreeDataProvider<CodempTreeIte
|
|||
if (element) {
|
||||
switch (element.type) {
|
||||
case Type.Workspace:
|
||||
if(client === null) {
|
||||
return [];
|
||||
}
|
||||
if (workspace === null) { return [] };
|
||||
let workspaces= await client.list_workspaces(true,true);
|
||||
if(workspaces.length===0) {
|
||||
let out = [];
|
||||
out.push(new CodempTreeItem("No workspaces", Type.Placeholder, false));
|
||||
return out;
|
||||
}
|
||||
if (element.label == workspace.id()) {
|
||||
return workspace.filetree(undefined, false).map((x) =>
|
||||
new CodempTreeItem(x, Type.Buffer, false, bufferMapper.bufferToEditorMapping.has(x))
|
||||
|
@ -46,6 +55,12 @@ export class CodempTreeProvider implements vscode.TreeDataProvider<CodempTreeIte
|
|||
if(client === null) {
|
||||
return [];
|
||||
}
|
||||
let workspaces= await client.list_workspaces(true,true);
|
||||
if(workspaces.length===0) {
|
||||
let out = [];
|
||||
out.push(new CodempTreeItem("No workspaces", Type.Placeholder, false));
|
||||
return out;
|
||||
}
|
||||
let items = workspace_list.map((x) =>
|
||||
new CodempTreeItem(x, Type.Workspace, true, workspace !== null && workspace.id() == x)
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue