Pregunta

I am using SublimeRope plugin. When I am typing from foo.b it displays the autocomplete dialog with random crap but what I am really looking for is to recognize bar module inside the foo package. However if I type from foo import b it immediately suggest me to import bar as a module. Which means Rope "knows" about that module. How can I configure my Sublime to help me suggest the imports when from foo.b ?

I am doing projects with django so the real example it wont me to autocomplete from django.contrib. but if I type from django.contrib.auth.models import U it suggest me to import user.

¿Fue útil?

Solución

You should definitely be using SublimeJEDI for Python autocompletion! There's no way around Jedi awesomeness.

This is just a Sublime Plugin for the Jedi library (which is definitely better than Rope, but I'm biased because I'm the author).

Otros consejos

Just adding to what other have said sublimecodeintel can help you with this. However to get it working with Django as you would like you have to add a configuration file pointing to django to your project. The instructions for how to do this are on the github page linked above. You'll add something similar to this:

    {
"Django":{
    "django":'/Users/bin/python2.7/site-packages/django'
    },
}

Have you checked out SublimeCodeIntel? It's available through Package Control, and has this functionality. The initial indexing of your packages may take some time, but once it's all set (you may need to restart Sublime once or twice to get everything loaded) it works like a charm.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top