Domanda

I'm looking for an extension which will help in Python's auto complete feature in Python.

If I type the following code:

a = [4,5,6]
a.p

Then I expect it would give me a suggestion for pop as it is one of the method of Python list. Is this thing achievable in Emacs?

I tried installing Rope, Rope mode, Ropemacs and Pymacs. The auto-complete suggestion, I get from that aren't the methods of list. But it suggests me something like print etc. Am I doing something wrong ?

È stato utile?

Soluzione

Try Jedi.el. AFAIK, it should support your example.

Altri suggerimenti

Because Python variables don't have types, it is difficult to know what class of object a variable would contain at a given point in your code. Imagine if your code later did a = 1. Emacs would have to know when the variable a refers to a list and when it refers to a number in order to offer the correct completion. Generally this is not possible without actually running the code.

Works for me with vimrope from https://github.com/python-rope/ropevim/ (now, the official home of all rope projects)

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top