Sublime Text 2. python `from` autocomplete

I am using the SublimeRope plugin. When I type from foo.b , it displays an autocomplete dialog with random crap, but what I'm really looking for is to recognize the bar module inside the foo package. However, if I type from foo import b , it immediately prompts me to import bar as a module. This means that the rope “knows” about this module. How to set up my Sublime to help me suggest importing when from foo.b ?

I am doing projects with django, so a real example cannot autocomplete me from django.contrib. but if I type from django.contrib.auth.models import U , he will prompt me to import the user.

+6
source share
3 answers

You must use SublimeJEDI to autocomplete Python! There is no way for the Jedi to be awesome.

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

+6
source

Just adding what others said sublimecodeintel can help you with this. However, to make it work with Django, since you need to add a configuration file pointing to django for your project. Instructions on how to do this are provided on the github page above. You will add something similar to this:

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

Have you checked SublimeCodeIntel ? It is available through Package Management and has this feature. Initial indexing of your packages may take some time, but as soon as all of this is installed (you may need to restart Sublime once or twice for everything to load), it works like a charm.

0
source

Source: https://habr.com/ru/post/950263/


All Articles