Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor improvements to completion #10350

Merged
merged 1 commit into from Mar 8, 2017

Conversation

Carreau
Copy link
Member

@Carreau Carreau commented Feb 27, 2017

If object being completed is a function, append () to match the
convention used in cpython doc. This include methods. Append () only
in the displayed menu, does not insert the ().

If completion is relatively to long (mostly if is does not come from
jedi), and use a fully qualified name with more than 3 parts, ellides
the middles one to . (This closes #9835).

@Carreau
Copy link
Member Author

Carreau commented Feb 27, 2017

Here is how it looks like not using jedi:

screen shot 2017-02-27 at 14 38 22

It does not affect completions that much when jedi is installed as jedi mostly returns all the completions that IPython finds with the right text:

screen shot 2017-02-27 at 14 39 13

the --jedi/ipython-- token is a debugging one you should not worry about.

cc @anntzer

@Carreau Carreau modified the milestone: 6.0 Feb 27, 2017
@anntzer
Copy link
Contributor

anntzer commented Feb 27, 2017

Works for me, thanks.

@@ -21,6 +21,23 @@

_completion_sentinel = object()

def _ellide(string, *, min_ellide=30):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's elide with one L.

However, ellipsis (plural ellipses) with two Ls is correct. English, such a wonderfully consistent language ;-)

If object being completed is a function, append `()` to match the
convention used in cpython doc. This include methods. Append `()` only
in the _displayed_ menu, does not insert the ().

If completion is relatively to long (mostly if is does not come from
jedi), and use a fully qualified name with more than 3 parts, ellides
the middles one to `…`. (This closes ipython#9835).
@Carreau
Copy link
Member Author

Carreau commented Mar 3, 2017

However, ellipsis (plural ellipses) with two Ls is correct. English, such a wonderfully consistent language ;-)

Fixed.

@Carreau Carreau merged commit 5d9dab8 into ipython:master Mar 8, 2017
@Carreau Carreau deleted the minor-completion-update branch March 8, 2017 22:38
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.

completion should favor displaying the actually completed part of the string rather than the prefix
3 participants