Skip to content

Implement copying python import path from opened file #25027

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

Open
s-kai273 opened this issue May 1, 2025 · 3 comments
Open

Implement copying python import path from opened file #25027

s-kai273 opened this issue May 1, 2025 · 3 comments
Labels
feature-request Request for new features or functionality needs community feedback Awaiting community feedback

Comments

@s-kai273
Copy link

s-kai273 commented May 1, 2025

Previously, I opened an issue suggesting the implementation of a feature to copy the Python import path.
I received a positive response indicating that a PR would be welcome if I were to implement it myself.
#23450 (comment)

So, I went ahead and implemented the feature and have now created a PR.
I would greatly appreciate it if you could review it.

I'm also happy to further discuss any necessary points in detail.
Thank you very much in advance!

@s-kai273 s-kai273 added the feature-request Request for new features or functionality label May 1, 2025
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label May 1, 2025
@karthiknadig karthiknadig added needs community feedback Awaiting community feedback and removed triage-needed Needs assignment to the proper sub-team labels May 14, 2025
Copy link

Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 7 👍 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.

@s-kai273
Copy link
Author

s-kai273 commented May 21, 2025

📄 Feature Overview

This feature introduces a "Copy Import Path" command for Python files in VS Code. By right-clicking on a Python file in the editor tab, users can select "Copy Import Path" to copy the module's import path to the clipboard.

Benefits:

  • Simplifies the process of obtaining the import path for a module.
  • Enhances productivity by reducing the steps needed to reference modules.
  • Useful for documentation, code reviews, and sharing code snippets.

🧪 How to Test the Feature

  • Open a Python file in VS Code.
  • Right-click on the file's tab to open the context menu.
  • Select the "Copy Import Path" option.
  • A notification should appear confirming that the import path has been copied to the clipboard.
  • Paste the clipboard content to verify the copied import path.

🙌 Request for Feedback

If you find this feature useful and would like to see it integrated into the Python extension for VS Code, please show your support by adding a 👍 reaction to the original issue comment. Gathering sufficient community feedback is crucial for the maintainers to consider this feature for future releases.
Your input is valuable, and any additional comments or suggestions are welcome.
Thank you for your time and support!

@s-kai273
Copy link
Author

Demo

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality needs community feedback Awaiting community feedback
Projects
None yet
Development

No branches or pull requests

2 participants