Add ability to create new folder in host browser

This commit is contained in:
nandi committed 2026-11-18 20:06:03 -08:00
1 parent 069e1d2082
commit 0805551109
5 files changed
+158 -4

No files matched your search

+6
View File
@@ -3,6 +3,7 @@ import type { PluginHandlerContext, PluginServerContext } from "@getpaseo/plugin
import { stat } from "node:fs/promises";
import { basename } from "node:path";
import {
createFolder,
detectPickers,
listDirectory,
pickFolder,
@@ -10,6 +11,7 @@ import {
resolveStartDir,
} from "./server/pick-folder";
import {
createFolderRpc,
detectRpc,
listDirRpc,
openFolderRpc,
@@ -94,6 +96,10 @@ export default function contribute(server: PluginServerContext) {
return openWorkspaceFolder(paseo, result.path, result.picker);
});
server.handle(createFolderRpc, async ({ parentPath, name }) => {
return createFolder(parentPath, name);
});
server.handle(listDirRpc, async ({ path, showHidden }) => {
const current = await readSettings();
return listDirectory(path ?? resolveStartDir(current.startDir), showHidden ?? false);