Release RuneStone 0.1.4 with installable plugins and settings
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
export function activate(api) {
|
||||
api.registerCommand({ id: "show-overview", title: "Show workspace overview", run: () => api.openView("overview") });
|
||||
api.registerView({
|
||||
id: "overview",
|
||||
title: "Workspace overview",
|
||||
async mount(container) {
|
||||
const status = document.createElement("p");
|
||||
status.textContent = "Loading workspace files…";
|
||||
container.append(status);
|
||||
let disposed = false;
|
||||
try {
|
||||
const entries = await api.workspace.list();
|
||||
if (api.signal.aborted || disposed) return;
|
||||
status.textContent = `${entries.length} files and folders in this workspace.`;
|
||||
const list = document.createElement("ul");
|
||||
for (const entry of entries) {
|
||||
const item = document.createElement("li");
|
||||
item.textContent = `${entry.name}${entry.kind === "folder" ? "/" : ""}`;
|
||||
list.append(item);
|
||||
}
|
||||
container.append(list);
|
||||
} catch (error) { status.textContent = String(error); }
|
||||
return () => { disposed = true; container.replaceChildren(); };
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user