Open the current file the source control platform's web UI. This is useful for sharing perma-links with collaborators. Install via the VSCode Marketplace or see Installation Instructions.
This extension adds 'Open in Browser' to the Command Palette. Running this command opens the default web browser to the currently edited file's URL in the web platform related to the Git origin (e.g. Github). The URL represents the current position of the cursor or the current multi-line selection.
Commonly used platforms such as Github and Gitlab are recognized automatically from the Git origin. Self-hosted web platforms such as Stash can be specified via the remote.$remoteName.url-platform
git configuration setting in the edited file's repo, for example:
git config --add remote.origin.url-platform stash
The following remote.config.url-platform options are supported:
- ado
- github
- gitlab
- stash
An extension-wide setting can also be configured as a default for all repos. The priority order for remote web platform resolution is:
- The
remote.origin.url-platform
setting described above. - Well-known domains guessed from the remote host (github.com, etc).
- The extension-wide setting.
VSCode 1.85.0 or newer
- An extension-wide setting for the web platform. This is a convenience to avoid configuring many per-repo settings for repos that would otherwise be unrecognized.
- Notifications for common error modes such as editing files that are not managed in Git
- Web platform resolution based on the remote URL's domain is now case-insensitive.
See CHANGELOG.md for release history and work-in-progress.
Compile before debugging. Debug (F5) while editing extension.ts
to spawn a VSCode debug instance.
$ npm run compile
Tests run within a VSCode execution environment.
$ npm run test