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.

all_completions returns nothing (simple fix suggested)

See original GitHub issue

The Completer.all_completions method, which emacs python.el and elpy mode use, is returning nothing defined in the current scope. For example:

In [87]: xxx = 2

In [91]: get_ipython().Completer.all_completions('x')
Out[91]: ['%xdel', '%xmode']

In [92]: get_ipython().Completer.all_completions('xx')
Out[92]: []

Internally it’s using jedi but discarding jedi completions. Now, all_completions calls the deprecated complete instead of completions. A simple change fixes both the usage of a deprecated method and a bug:

In [127]: list(map(lambda c: c.text, get_ipython().Completer.completions('x', len('x'))))
Out[127]: ['xxx', '%xdel', '%xmode']

Why not redefining all_completions like that? At least the following is working for me inside an emacs inferior python session:

get_ipython().Completer.all_completions = lambda t: map(lambda c: c.text, get_ipython().Completer.completions(t, len(t)))

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
memeplexcommented, Jan 28, 2019

@Carreau would you consider adding this to the next milestone? It’s easy to fix and it’s really critical for emacs users. Thanks!

0reactions
memeplexcommented, Feb 11, 2019

Can we close this? The fix has already been merged.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[ST4] gopls: LSP not showing all completions provided by ...
Then quickly type a . (dot). This makes gopls return nothing. We seem to do everything correctly here: :: -> gopls textDocument/didChange ...
Read more >
Managed expression - Arcade - Esri Community
Easy fix: just list your conditions in order of specificity. If your fields would not evaluate to being "Complate", then it's fine to...
Read more >
Customizing bash completion output: each suggestion on a ...
I'm looking for a solution to display each possible solution on a new line, similar to the last column on a ls -l...
Read more >
Turn auto complete on for Mac Terminal - Edward Beazer Blog
Save a lot of time by turning on autocomplete for your terminal · Press command key + x to save, then press y...
Read more >
ChangeLog-16-current - Index of / - Asterisk.org
In this case, since reading ast_str_strlen returns 0, the returned substring is empty as opposed to the ... Fix suggested by Ross Beer...
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