-
Notifications
You must be signed in to change notification settings - Fork 769
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
Add an action to copy a link to a file in the online repository for a module dependency #3656
Comments
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. 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. |
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 |
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
@firelizzard18 yeap you are right that is what i meant. I think even if supporting just the common code hosting sites is good enough for most open source projects. Already makes it easier to reference open source libraries. |
@h9jiang thank you for pointing out gitlens. I do have gitlens too and i was unable to refer to the lib that are imported. |
Copy Link To File
on imported packages
@YesYouKenSpace Can you clarify when you want this option to appear? I can think of multiple scenarios. I had been thinking when you right click the file tab after opening a file from the module cache as in [right click method/etc] -> [go to definition] -> [right click file tab] -> [copy link] but from your screenshot it looks like you want this option to appear when right clicking a definition, as in [right click method/etc] -> [copy link] as an alternative to [go to definition]. |
@firelizzard18 i expect it to be available at a right click on any line within a file of the module cache. I believe that to be the most intuitive. I imagine myself navigating in the team codebase and then travelling to the public library definition and finding a piece of code in the module cache that explains a behaviour and wanting to link my teammates to that line. |
That's sufficiently clear. The request is:
As far as implementation, it should be relatively straightforward for github, gitlab, and other well-known providers. Supporting arbitrary providers (e.g. custom GitLab deployments such as https://gitlab.freedesktop.org/) will require checking for a go-source meta tag with a go-get query as I mentioned before #3656 (comment). |
Thank you good sir @firelizzard18, ah yes i probably should have just started with a user story. |
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
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: