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/d4rkr00t/vscode-open-in-github/blob/917e4c6506d87b99cbc0c4c560d846434e819684/src/file.ts#L12-L20
https://github.com/d4rkr00t/vscode-open-in-github/blob/917e4c6506d87b99cbc0c4c560d846434e819684/src/file.ts#L12-L20
...and to show src/file.ts in VSCode with the code selection line 12-20 (extracted from the URL #L12-L20).
Any thoughts?
Just so you know, your "Open in GitHub" extension has improved my dev workflow so I am really thankful. Note that for the reverse operation I now use this "Open" extension: https://github.com/alexander-yu/vscode-open The filesystem absolute paths (e.g. VSCode workspace) must currently be hard-coded, but configuring the extension for my local personal use is easy enough:
"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": "#"
}
]
I use the two VSCode extensions together during peer code reviews, as we use GitHub's own source browser a lot to communicate over Slack. So being able to convert a GitHub source tree URL to VSCode file (and vice-versa) is great!