Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Buildout-aware Python autocompletion for Sublime Text

Are there any tricks how one could make Sublime Text's Python autocompletion aware off all eggs from buildout's [eggs] section

E.g. grab the same sys.path as in Plone's generated bin/instance command and expose them to Sublime's auto-completion. You could easily auto-complete imports and stuff after this.

A preferable solution would be

  • Have special bin/sublime command generated by buildout

  • This command would open src/ folder as Sublime text (project?) with all necessary environment variables and stuff set

Other solutions / ideas welcome.

like image 982
Mikko Ohtamaa Avatar asked May 10 '12 19:05

Mikko Ohtamaa


2 Answers

Check http://pypi.python.org/pypi/corneti.recipes.codeintel/0.1.3

This is even easier than Martin's solution, I use it together with omelette with a part like this in my development.cfg buildout

[codeintel]
recipe = corneti.recipes.codeintel
eggs = ${buildout:eggs}
extra-paths =
    ${omelette:location}
like image 55
Franklin Kingma Avatar answered Nov 12 '22 19:11

Franklin Kingma


I, like Martin Aspelli, use the SublimeCodeIntel plugin; together with collective.recipe.omelette this fills all my code-completion needs. Martin blogged about his setup, including a little script that sets up the CodeIntel configuration file for you:

http://www.martinaspeli.net/articles/sublime-text-2-for-zope-and-plone

like image 28
Martijn Pieters Avatar answered Nov 12 '22 20:11

Martijn Pieters