Skip to content

Commit f632a64

Browse files
committed
fix CONTRIBUTING.md
COPYING.rst IPython LICENSE MANIFEST.in README.rst SECURITY.md __pycache__ _build_meta.py codecov.yml docs examples ipython.egg-info long_description.rst pyproject.toml scripts setup.cfg setup.py setupbase.py tests tools case
1 parent 117aaa0 commit f632a64

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

IPython/core/completer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2605,7 +2605,7 @@ def _determine_completion_context(self, line):
26052605
return self._CompletionContextType.GLOBAL
26062606

26072607
# Handle all other attribute matches np.ran, d[0].k, (a,b).count
2608-
chain_match = re.search(r".*(.+\.(?:[a-zA-Z]\w*)?)$", line)
2608+
chain_match = re.search(r".*(.+(?<!\s)\.(?:[a-zA-Z]\w*)?)$", line)
26092609
if chain_match:
26102610
return self._CompletionContextType.ATTRIBUTE
26112611

tests/test_completer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2637,6 +2637,7 @@ def test_no_file_completions_in_attr_access(code):
26372637
('f"formatted {obj.attr}', "global"),
26382638
("dict_with_dots = {'key.with.dots': value.attr", "attribute"),
26392639
("d[f'{a}']['{a.", "global"),
2640+
("ls .", "global"),
26402641
],
26412642
)
26422643
def test_completion_context(line, expected):

0 commit comments

Comments
 (0)