Sublime Forum

Goto Definition of third-party packages

#1

Is there a way to use Goto Definition on installed third-party packages? e.g. I’d like to jump from forms.ValidationError(...) in my source code to .../site-packages/django/core/exceptions.py:124.


Sublime Text 4 (4143)
The project use Python, Django and virtualenv.

0 Likes

#2

For the built-in goto-definition to work it needs to index all related code - ie. have them open in the side-bar and not ignored by settings.

0 Likes

#3

Thanks, Benjamin.

The virtual environment for the project is stored (locally) within the git repo, but is ignored from git by adding the folder to the .gitignore file. I’ve tried to use index_include_patterns setting in Sublime’s Project settings file, but it looks like I also need to set index_exclude_gitignore: false for this to work. However, setting that to false ultimately means everything is indexed and therefore makes the index_include_patterns redundant.

Is there a way to use index_include_patterns, or similar, without disabling index_exclude_gitignore for files/folders that are in gitignore?

0 Likes

#4

lsp and lsp-pyright will do if you welcome plugins.

1 Like

#5

Not currently no. index_exclude_gitignore takes precedent over the patterns.

1 Like