You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add the ability to copy the python import path to the clipboard #16997
Originally posted by jarshwah August 10, 2021 I want to be able to right click a file and copy the import path to that file so that I may paste it into a terminal/repl to gain access to those functions without having to type a long import path
For context, a project I work on can have modules and packages nested quite deeply (10 or so levels deep). I often have to type out an extremely long import string during exploratory sessions, and would love to be able to copy a path from a file I'm looking at directly into the terminal.
Apologies I had meant to respond to the discussion and then it dropped off my tab list/radar.
To answer your question around algorithm, I had the following (perhaps incorrect) assumptions in mind:
The language server knows what the root of the project is in most cases (pyproject, vscode config, etc) so init files don't need to be inspected to find the root
Given the language server knows the root, traverse from current file to root, and that is more than likely your import path
If it can't be resolved that way, repeat for all known roots (pythonpath, etc)
I have very little understanding of the language server implementation and capabilities, and haven't spent nearly as much time thinking about these strategies as someone more familiar. I would not be surprised if I was way off the mark.
Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 5 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue.
Thank you for submitting your feature request and everyone who considered it! Unfortunately this issue did not receive enough votes over the allotted time, and so we are closing the issue.
Activity
jarshwah commentedon Aug 17, 2021
Apologies I had meant to respond to the discussion and then it dropped off my tab list/radar.
To answer your question around algorithm, I had the following (perhaps incorrect) assumptions in mind:
I have very little understanding of the language server implementation and capabilities, and haven't spent nearly as much time thinking about these strategies as someone more familiar. I would not be surprised if I was way off the mark.
brettcannon commentedon Sep 1, 2021
Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 5 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue.
brettcannon commentedon Nov 1, 2021
Thank you for submitting your feature request and everyone who considered it! Unfortunately this issue did not receive enough votes over the allotted time, and so we are closing the issue.