Skip to content

Limit file completions to path contexts#15288

Open
cjc0013 wants to merge 1 commit into
ipython:mainfrom
cjc0013:fix-file-completion-context
Open

Limit file completions to path contexts#15288
cjc0013 wants to merge 1 commit into
ipython:mainfrom
cjc0013:fix-file-completion-context

Conversation

@cjc0013

@cjc0013 cjc0013 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • limit filename completions to string literals, shell/magic contexts, and explicit path-looking tokens
  • keep direct path completion for prefixes such as ./, ../, ~, absolute paths, and Windows drive paths
  • include name = !command as shell syntax by reusing IPython's system-assignment tokenizer

Fixes #14501.

Local checks

  • python -m pytest tests/test_completer.py::TestCompleter::test_file_completions_only_in_path_contexts tests/test_completer.py::TestCompleter::test_local_file_completions -q
  • python -m pytest tests/test_completer.py -q
  • python -m ruff check IPython/core/completer.py
  • python -m compileall -q IPython/core/completer.py tests/test_completer.py
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Only trigger filename completion in special syntax or strings

1 participant