vscode-copy-github-url
vscode-copy-github-url copied to clipboard
Feature request: inverse operation, start with a GitHub URL which contains hash line number(s), and open the file in VSCode at the designated line / code selection
Hello, great extension, thank you! Very useful for code peer reviews over Slack / instant messaging, to exchange URLs whilst working locally from VSCode. However the inverse functionality would be very useful too.
For example I would like to be able to copy such URL: https://github.com/differentmatt/vscode-copy-github-url/blob/ad85a468eb8f1b05979591335ba391c58abeb5a7/src/main.js#L6-L8
https://github.com/differentmatt/vscode-copy-github-url/blob/ad85a468eb8f1b05979591335ba391c58abeb5a7/src/main.js#L6-L8
...and to show src/main.js in VSCode with the code selection line 6-8 (extracted from the URL #L6-L8).
Any thoughts?
Cool idea. What do you think the user experience would be to enter this URL into VSCode and open the correct file with selection?
Could it be a command that would prompt the user to paste?
Hello again!
Disclosure: some months ago I settled on https://github.com/d4rkr00t/vscode-open-in-github for the vscode-to-browser operation, but I am glad other alternatives such as differentmatt/vscode-copy-github-url exist :)
For the reverse browser-to-vscode operation I have been using https://github.com/alexander-yu/vscode-open but the experience is not totally friction-free due to necessary configuration, e.g.:
"open.uriMappings": [
{
"pattern": "https://github.com/owner1/repo1/(?<blob>[^/]+)/(?<ref>[^/]+)/${regex:file}${regex:lines}",
"output": "/Users/danielweck/GitHub/owner1/repo1/${match:file}${match:lines}",
"lineSeparator": "#"
},
{
"pattern": "https://github.com/(?<owner>[^/]+)/(?<repo>[^/]+)/(?<blob>[^/]+)/(?<ref>[^/]+)/${regex:file}${regex:lines}",
"output": "${match:file}${match:lines}",
"lineSeparator": "#"
}
]