Add completion, browser integration, and workspace improvements
This commit is contained in:
@@ -11,6 +11,24 @@ function fixture() {
|
||||
}, () => {}, () => {});
|
||||
return { session, writes: () => writes };
|
||||
}
|
||||
|
||||
test("native Markdown discovery remains optional and is revoked on disable", async () => {
|
||||
let api!: PluginApi;
|
||||
let scans = 0;
|
||||
const session = new ExternalSession("org.test.scan", {
|
||||
workspace: { list: async () => [], listMarkdown: async () => { scans++; return ["Notes/task.md"]; }, read: async () => "", write: async () => {} },
|
||||
settings: { read: async () => null, write: async () => {} },
|
||||
assets: { read: async () => new Uint8Array() },
|
||||
}, () => {}, () => {});
|
||||
await session.start({ activate(value) { api = value; } });
|
||||
assert.deepEqual(await api.workspace.listMarkdown!(), ["Notes/task.md"]);
|
||||
await session.stop();
|
||||
assert.throws(() => api.workspace.listMarkdown!(), /disabled/);
|
||||
assert.equal(scans, 1);
|
||||
const old = fixture().session;
|
||||
await old.start({ activate(value) { assert.equal(value.workspace.listMarkdown, undefined); } });
|
||||
await old.stop();
|
||||
});
|
||||
test("external commands run and all host access stops before cleanup", async () => {
|
||||
const { session, writes } = fixture(); let api!: PluginApi; let ran = 0;
|
||||
await session.start({ activate(value) {
|
||||
|
||||
Reference in New Issue
Block a user