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

Allow Copy Link To File on imported packages #3656

Open
YesYouKenSpace opened this issue Jan 9, 2025 · 2 comments
Open

Allow Copy Link To File on imported packages #3656

YesYouKenSpace opened this issue Jan 9, 2025 · 2 comments
Labels
WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@YesYouKenSpace
Copy link

Is your feature request related to a problem? Please describe.
I would like to share reference to lines of code in public repository of imported packages when discussing issues with my teammates.

Describe the solution you'd like
It would be nice to have an action item in the context menu under Copy As > Copy link to remote repository
image

Describe alternatives you've considered

Additional context

@gopherbot gopherbot added this to the Untriaged milestone Jan 9, 2025
@h9jiang
Copy link
Member

h9jiang commented Jan 9, 2025

Hi YesYouKenSpace,

I find a tool offered from GitLens. I'm not sure if this is something you are looking for. If you configured correctly, you will find options below.

image

But this is limited to understanding your repo allow you to customize the repo url with file, line and range parameter. It does not understand the library you imported in your repo unless you vendor them (make those as part of your repo). But standard lib is always out of reach because it can not be vendored.

@h9jiang h9jiang added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jan 9, 2025
@firelizzard18
Copy link
Contributor

I think what they mean is: If I open a file from the module cache (for example by using "Go to definition" on an imported type), I want a "Copy link to file" menu option that links to the online repository for that package. I don't think GitLens can solve this because the module cache files aren't git repositories.

@YesYouKenSpace If I'm correct this would be tricky to handle in the general case. Obviously if the module starts with github.com it's not that hard to determine a browsable URL for that file. However supporting other providers would require a go-get query for each module and that only works if the provider includes a go-source meta tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants