Skip to content

Fix completion tuple#14594

Merged
Carreau merged 2 commits intoipython:mainfrom
Carreau:comptup
Dec 8, 2024
Merged

Fix completion tuple#14594
Carreau merged 2 commits intoipython:mainfrom
Carreau:comptup

Conversation

@Carreau
Copy link
Copy Markdown
Member

@Carreau Carreau commented Dec 2, 2024

In progress work toward #14585

guarded eval strip leading characters until it find soemthing, this is problematic as (1, x, becomes valid after 1 char strip: 1, x is a tuple;

So now we trim until it is valid an not a tuple.

This is still imperfect as things like (1, a[" "].y will be trimmed to y, while it should stop with a[" "].y ?

I think maybe we should back-propagate; build back up from y, to a[" "].y, greedily until we get the last valid expression – skipping any unbalanced parentheses/quotes if we encounter imblanced.

@Carreau
Copy link
Copy Markdown
Member Author

Carreau commented Dec 2, 2024

cc @krassowski to not duplicate work.

@Carreau Carreau force-pushed the comptup branch 2 times, most recently from bcca648 to 8cf1701 Compare December 8, 2024 10:56
@Carreau Carreau marked this pull request as ready for review December 8, 2024 11:08
@Carreau Carreau added this to the 8.31 milestone Dec 8, 2024
The selection of the current expression was improperly
finding an implicit tuple `a,b`, instead of trimming tosimply `b`.

I also done a number of simplification of test cases.
@Carreau Carreau merged commit 9cdf92d into ipython:main Dec 8, 2024
@Carreau Carreau deleted the comptup branch December 8, 2024 11:23
@Carreau Carreau modified the milestone: 8.31 Dec 8, 2024
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.

1 participant