This repository was archived by the owner on Jun 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open file from GitHub (MVP) #2060
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When user clones a /blob/ type URL, navigate to the file after cloning/opening the repository.
990782b to
cadf19a
Compare
Default to clipboard URL when cloning form Start Page and Connect page. This makes it consistent with current File > Open > Open from GitHub behavior.
b32ad70 to
999e41b
Compare
Remove gitHubContextService from OpenFromUrlCommand.
75164dc to
d3228ab
Compare
Move context changing responsibilities away from RepositoryCloneService.
Warn when blob can't be found in the repository. Warn when the working file is different blob URL file.
f9f7bd8 to
030e2da
Compare
Contributor
|
I opened the dialog with some random markdown in my clipboard. |
grokys
approved these changes
Nov 30, 2018
Don't close solution and open folder view when solution is already in the targeted repository.
Collaborator
Author
|
Thanks @StanleyGoldman, will fix #2060 (comment) next week in a separate PR. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

This is a MVP implementation of open file from GitHub functionality.
With this functionality the user can paste a
/blob/style URL into theURLtab of theOpen from GitHubdialog and be taken to the file/line/range after the target repository is opened or cloned.When the target
/blob/isn't available in the working directory, a dialog will appear letting the user know about the problem. There is no functionality to assist navigation to an alternative remote branch or pull request (if that is where the/blob/URL is from).This functionality isn't advertised/discoverable and will be primarily used for gathering user feedback and testing when the functionality is explicitly pointed out.
Scope of MVP
https://github.com/owner/repo/blob/<branch>/<path>/<file>style URLshttps://github.com/owner/repo/blob/<SHA>/<path>/<file>style URLs#L10and#L25-L33)Next iteration
Open from GitHub / URLpageWhat this PR does
Open from GuitHubandOpen from ClipboardfunctionalityURLtab ofOpen from GitHubdialog when there is a GitHub URL in the clipboard.GitHubContextService.TryNavigateToContextfor syncing Visual Studio context with context from a/blob/URL/blob/URL/blob/URL doesn't exist in local repository/blob/URL is a permalink, we don't currently know the remote branch/PR it is associated withNotes and Issues
When a user opens a blob permalink, we don't know the name of the branch they're targeting
When a user opens a blob from a named branch, files on the current branch might be different to the target branch
If the user hasn't recently done a fetch, the targeted commit might not exist or the link might be out of date (if it uses a named branch)
When a range of lines is selected and a solution is opened using
Team Explorer - Home, the selected text is lost but the caret position remains the sameDiscoverability
This feature isn't being advertised in the MVP
With this new functionality a user can paste a
blobstyle URL into theOpen from GitHubdialog and have the target file and line number/range selected as soon as thecloneorOpencompletes. We need to find a way to make this functionality discoverable.Currently is a user copies a
blobstyle URL into their clipboard clicksFile > Open > Open from GitHub..., they will be presented with this:If there is no URL in the clipboard, they will see this:
For the MVP I think it would make sense to work on these incrementally. Start off with a static description and only show elements of the deconstructed URL if they're deemed to be particularly useful.
What do you think @donokuda?