Skip to content

Commit 0a3980f

Browse files
committed
chore(cli[load]): Remove unused function workspace_file_completion
1 parent d511a38 commit 0a3980f

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

src/tmuxp/cli/load.py

+1-23
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from .. import config_reader, exc, log, util
2222
from ..workspace import loader
2323
from ..workspace.builder import WorkspaceBuilder
24-
from ..workspace.finders import find_workspace_file, get_workspace_dir, in_dir
24+
from ..workspace.finders import find_workspace_file, get_workspace_dir
2525
from .utils import prompt_choices, prompt_yes_no, style, tmuxp_echo
2626

2727
if t.TYPE_CHECKING:
@@ -468,28 +468,6 @@ def load_workspace(
468468
return _setup_plugins(builder)
469469

470470

471-
def workspace_file_completion(ctx, params, incomplete):
472-
workspace_dir = pathlib.Path(get_workspace_dir())
473-
choices: t.List[pathlib.Path] = []
474-
475-
# CWD Paths
476-
choices += sorted(
477-
pathlib.Path(os.path.relpath(p, pathlib.Path.cwd()))
478-
for p in [pathlib.Path.cwd(), *pathlib.Path.cwd().parents]
479-
if in_dir(str(p)) or len(list(p.glob(".tmuxp.*")))
480-
)
481-
# CWD look one directory up
482-
choices += [
483-
pathlib.Path(f"./{os.path.relpath(p, pathlib.Path.cwd())}")
484-
for p in pathlib.Path.cwd().glob("*/.tmuxp.*")
485-
]
486-
487-
# Project workspace
488-
choices += sorted((workspace_dir / c).stem for c in in_dir(str(workspace_dir)))
489-
490-
return sorted(str(c) for c in choices if str(c).startswith(incomplete))
491-
492-
493471
def create_load_subparser(parser: argparse.ArgumentParser) -> argparse.ArgumentParser:
494472
workspace_files = parser.add_argument(
495473
"workspace_files",

0 commit comments

Comments
 (0)