From c1fe6889569610878c45216556fb99424b5bcba4 Mon Sep 17 00:00:00 2001
From: Yuki Okita <ktewqp98r@gmail.com>
Date: Thu, 31 Jul 2025 05:38:20 +0900
Subject: feat: Multi-Directory Workspace Support (part1: add
 `--include-directories` option) (#4605)

Co-authored-by: Allen Hutchison <adh@google.com>
---
 packages/cli/src/ui/components/InputPrompt.tsx | 11 +++++++++++
 1 file changed, 11 insertions(+)

(limited to 'packages/cli/src/ui/components/InputPrompt.tsx')

diff --git a/packages/cli/src/ui/components/InputPrompt.tsx b/packages/cli/src/ui/components/InputPrompt.tsx
index 17b7694e..5a7b6353 100644
--- a/packages/cli/src/ui/components/InputPrompt.tsx
+++ b/packages/cli/src/ui/components/InputPrompt.tsx
@@ -60,8 +60,19 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
 }) => {
   const [justNavigatedHistory, setJustNavigatedHistory] = useState(false);
 
+  const [dirs, setDirs] = useState<readonly string[]>(
+    config.getWorkspaceContext().getDirectories(),
+  );
+  const dirsChanged = config.getWorkspaceContext().getDirectories();
+  useEffect(() => {
+    if (dirs.length !== dirsChanged.length) {
+      setDirs(dirsChanged);
+    }
+  }, [dirs.length, dirsChanged]);
+
   const completion = useCompletion(
     buffer,
+    dirs,
     config.getTargetDir(),
     slashCommands,
     commandContext,
-- 
cgit v1.2.3

