squ1b3r / Djaneiro

Django support for Sublime Text 2/3
MIT License
855 stars 131 forks source link

Adds urls.py indexer and autocomplete #133

Closed scuml closed 2 years ago

scuml commented 2 years ago

This one's a game-changer.

This branch creates an index of named urls available to django and allows them to be used as autocomplete items within {% url %} tags and reverse( method calls. This saves an incredible amount of time and mental energy flipping back and forth from urls.py with the name and parameters used in a url.

Depends on comment/uncomment branch, so merging that first will clean up the 'changed files' list.

ScreenFlow

squ1b3r commented 2 years ago

Damn, dude. You are on fire! xD

Before I do any reviews, I see there are imports that require Django. What happens if the user doesn't have it installed? Or it's installed in a virtualenv which Sublime Text has no access to?

scuml commented 2 years ago

The url-indexer uses the project setting: python_interpreter to make sure that url_extract.py is run through the user's virtualenv. If django does not exist in the virtualenv, the plugin silently stops indexing.

squ1b3r commented 2 years ago

Thanks again for this contribution!