Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Library sources support #404

Open
vlad17 opened this issue Oct 3, 2021 · 0 comments
Open

Library sources support #404

vlad17 opened this issue Oct 3, 2021 · 0 comments

Comments

@vlad17
Copy link

vlad17 commented Oct 3, 2021

dumb-jump looks really cool, thank you for making it!

Often, I'll want to go to the definition of a library function outside of my current repository.

dumb-jump supports this through .dumbjump by letting me add additional paths:

-tests
+/home/vlad/.local/lib/python3.8/site-packages

where the above would let me go to definition for locally installed pip packages in my system python.

However, often times library sources are in weird places. This differs user-to-user (e.g., b/c $HOME does) and is dependent on python configuration. For instance, for my recent poetry-based project, the python library sources would be found with:

+/home/vlad/.cache/pypoetry/virtualenvs/$project-L7SDcTsr-py3.8/lib/python3.8/site-packages
+/home/vlad/.cache/pypoetry/virtualenvs/$project-L7SDcTsr-py3.8/local/lib/python3.8/dist-packages
+/home/vlad/.cache/pypoetry/virtualenvs/$project-L7SDcTsr-py3.8/lib/python3/dist-packages
+/home/vlad/.cache/pypoetry/virtualenvs/$project-L7SDcTsr-py3.8/lib/python3.8/dist-packages

Obviously, this is all very user and system and language dependent, but if dumb-jump.el were to provide a hook to add include paths dynamically (i.e., after loading a .dumbjump config), then I could add my own elisp logic which could dynamically generate system library paths based on the current buffer. E.g., if the lang is python then my hook could run poetry run python -c 'import site; print(site.getsitepackages())' and add those to the :include config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant