"Copy Permalink" functionality for Visual Studio to generate links to ADO/GitHub repos
- Dominant language
- C#
- Stars
- 1.4k
- Forks
- 148
- PR merge metrics
- No merged PRs in 30d
Description
This functionality in the GitHub Codespaces VSCode extension is **SUPER** useful for quickly sharing code snippets with other people. I can select a block of text, and the "Copy GitHub Permalink" dropdown option will generate a permalink to the correct GitHub repo, using my current commit hash to create a permalink to the same block of code. This has a HUGE impact on my workflow for quick knowledge sharing with other people on my team.
Screenshot example:

Generates the following link:
https://github.com/Azure/bicep/blob/c47a85598760ca55f325dc3af26deb69fe11ff64/src/Bicep.Core/Semantics/SemanticModel.cs#L35-L39
The benefit of a permalink to a commit hash (vs a link to a particular branch) is that I can paste it in emails, wikis, etc - and not have to worry about the line information being changed by a different commit in the future.
My current workflow to share a link to a code block in ADO is very tedious - I have to:
1. Find the code in VS
1. Open ADO to the same page
1. Use the ADO UI to locate the same code block and copy it to clipboard
1. Manually update the ADO URL to convert branch reference -> git hash (ADO doesn't seem to have the capability to generate permalinks)
I would **love** to have this same functionality in Visual Studio, to be able to generate a link to an ADO repo or a GitHub repo, and my naïve understanding is that SourceLink should capture enough information to make this possible.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.