Python Code Completion (JEDI)


#1

In Sublime, I make extensive use of SublimeJedi to do code intelligent completion of python both for python core, 3rd party libraries and my own code. I did some googling, but can’t find an alternative for Atom at the moment. Have I overlooked something?

Cheers,

Douglas


Python jedi: autocomplete-jedi
#2

I use this package for autocompletion. I think it’s fantastic!


Add external python API for autocompletion
#3

Yes, I have seen autocomplete-plus, but it does not do what I am looking for at all. Jedi is inspecting Python files and then giving autocompletions based on that. For example, if you type
from sys import then a dropdown will appear with all the classes and functions that exist in that package. Or if I write a class in file mine.py

class MyClass(object):
    def add(self, x, y):
        return x + y

Then if I do in another file:

from mine import MyClass
m = MyClass()

Then when I type m. the first suggestion will be m.add. If I then accept that so I’ve done:

from mine import MyClass
m = MyClass()
m.add

If I then type ( SublimeJedi will automatically fill in the arguments so it looks like this

from mine import MyClass
m = MyClass()
m.add(x, y)

This is a very powerful feature.


#4

Looks like it has gotten started


#5

Excellent news, this is the main reason I haven’t been able to really give atom a serious try.


#6

@dpwrussell & @freakypie,
Were you able to get jedi to work in atom?
I installed it, but it doesn’t seem to be doing anything at all.


#7

Any answers here?
I have installed to but couldn’t use on Mac. I tried with the shortcut crtl+cmd+space (crtl+alt+space) and nothing happened. Anyone can help finding why? Thanks.


#8

The package might have installed a command into the command palette – try Cmd-Shift-P.

You can enable the keyboard logger (Cmd-.), then hit the key, then see what happens when you do.

You can also go to settings, then keyboard shortcuts, then search for the command. This would tell you the binding.


#9

Solved. Thank you.


#10

What was the solution? So that others can profit from it, as well.


#11

Just changed the keymap. I think Mac OS X use the same shortcut.


#12

There’s also https://atom.io/packages/autocomplete-plus-python-jedi available now, which probably works in cases where autocomplete-jedi doesn’t (since it does not use XML-RPC, comes with bundled Jedi, …)

It also has some additional features, like argument completion, (soon) integrated docstrings, etc… :slight_smile:


#13

I moved a post to a new topic: Python autocomplete for .pyd files