summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/components/InputPrompt.tsx
diff options
context:
space:
mode:
authorYuki Okita <[email protected]>2025-07-31 05:38:20 +0900
committerGitHub <[email protected]>2025-07-30 20:38:20 +0000
commitc1fe6889569610878c45216556fb99424b5bcba4 (patch)
treeb96f5f66bc00426fcd3e4b87402067342abbce12 /packages/cli/src/ui/components/InputPrompt.tsx
parent21965f986c8aa99da5a0f8e52ae823bb2f040d7a (diff)
feat: Multi-Directory Workspace Support (part1: add `--include-directories` option) (#4605)
Co-authored-by: Allen Hutchison <[email protected]>
Diffstat (limited to 'packages/cli/src/ui/components/InputPrompt.tsx')
-rw-r--r--packages/cli/src/ui/components/InputPrompt.tsx11
1 files changed, 11 insertions, 0 deletions
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,