question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hi,

If I have a long name I am trying to autocomplete, this no longer is useful. Would it be possible to allow for one of the following:

  1. Allow the part already typed to not be included
  2. Ellipsis the start not the end of the string
  3. Allow for the text displayed in the UI to not be the text updates what is selected

While below is contrived, this happens with autocomplete of long chains of properties. Reproducer:

import random
import string

def randomString(stringLength=10):
    """Generate a random string of fixed length """
    letters = string.ascii_lowercase
    return ''.join(random.choice(letters) for i in range(stringLength))

def my_completer(c, text):
    longstr = 'AUTO_COMPLETE_A_VERY_LONG_STRING_BECAUSE_SOMETIMES_THIS_HAPPENS'
    if text.startswith(longstr):
        return [(longstr + randomString()).decode('utf8') for x in range(150)]
    return []

get_ipython().set_custom_completer(my_completer, 0)

image

Python 2.7.15 IPython 5.8.0 PromptToolkit: 1.0.15

Please also let me know if this is available in a later version of prompt_toolkit.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Carreaucommented, May 4, 2020

https://github.com/ipython/ipython/pull/12284 does some of that on the IPython side.

0reactions
Carreaucommented, May 4, 2020

Sidenote, the example at the top will not work on Py3, because it tries to decode a string (which Python 2 does because f casting)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Long & Elegant Baby Names for Boys & Girls - SheKnows
Long & elegant names for baby girls. Alannah · Annabelle · Anastasia · Angelica · Antoinette · Caledonia · Caroline · Cecilia ·...
Read more >
101 Beautiful Long Names for Girls 2022 - Good Housekeeping
Most Popular Long Names for Girls · Charlotte · Isabella · Abigail · Elizabeth · Scarlett · Eleanor · Madison · Penelope ...
Read more >
Long Baby Names: The Ultimate Guide | Nameberry
Long Baby Names: The Ultimate Guide ; Clementine and Evangeline ; Andromeda, Ariadne ; Anne Cole works well enough, but how about Annika...
Read more >
50+ Long & Elegant Baby Names That Are Just the Right ...
Long & elegant names for baby girls · Alannah · Annabelle · Anastasia · Angelica · Antoinette · Caledonia · Caroline · Cecilia....
Read more >
125 Best Long Names for Boys - Parade
125 Long Names for Boys · 1. William · 2. Benjamin · 3. Theodore · 4. Alexander · 5. Jackson · 6. Michael...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found