Skip to content

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 #16

Description

@danielweck

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/gimenete/github-linker/blob/8a57d4771ee68a202f6f987cdd724ab8007da69a/src/extension.ts#L11-L22

function getGitHubRepoURL(url: string) {
if (url.endsWith('.git')) {
url = url.substring(0, url.length - '.git'.length);
}
if (url.startsWith('https://github.com/')) {
return url;
}
if (url.startsWith('git@github.com:')) {
return 'https://github.com/' + url.substring('git@github.com:'.length);
}
return null;
}

...and to show src/extension.ts in VSCode with the code selection line 11-22 (extracted from the URL #L11-L22).

Any thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions