Skip to content

Commit 8db6904

Browse files
committed
cli: Properly guess index path when completing query
* bdx/cli.py (_complete_query): Use `guess_index_path_for_directory' in case index path is not provided and directory was guessed.
1 parent 402938b commit 8db6904

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

bdx/cli.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,10 +400,16 @@ def _complete_query(
400400
directory = ctx.params["directory"]
401401
index_path = ctx.params["index_path"]
402402

403+
did_guess_directory = False
404+
403405
if not directory:
404406
directory = default_directory(ctx)
407+
did_guess_directory = True
405408
if not index_path:
406-
index_path = SymbolIndex.default_path(directory)
409+
if not did_guess_directory:
410+
index_path = SymbolIndex.default_path(directory)
411+
else:
412+
index_path = guess_index_path_for_directory(directory)
407413

408414
query = ctx.params[param.name or "query"] or []
409415
shell = os.environ.get("_BDX_COMPLETE", "").lower()

0 commit comments

Comments
 (0)