From 93c3a34b4799341c8ffb34643ccaf35ad8b4f88d Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Tue, 19 Jul 2022 13:50:03 +0200 Subject: [PATCH] Template completion for #inst --- packages/plugs/query/complete.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/plugs/query/complete.ts b/packages/plugs/query/complete.ts index 0c58b92..47ceb32 100644 --- a/packages/plugs/query/complete.ts +++ b/packages/plugs/query/complete.ts @@ -29,4 +29,15 @@ export async function queryComplete() { })), }; } + + prefix = await matchBefore('#inst "[^"]*'); + if (prefix) { + let allPages = await listPages(); + return { + from: prefix.from + '#inst "'.length, + options: allPages.map((pageMeta) => ({ + label: pageMeta.name, + })), + }; + } }