New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create gist from Visual Studio #39

Closed
tkirill opened this Issue Aug 6, 2015 · 16 comments

Comments

Projects
None yet
9 participants
@tkirill
Contributor

tkirill commented Aug 6, 2015

Is it possible to create gist from selected lines with this extension?

@Haacked

This comment has been minimized.

Show comment
Hide comment
@Haacked

Haacked Aug 6, 2015

Member

Not today, but it wouldn't be hard to add.

Member

Haacked commented Aug 6, 2015

Not today, but it wouldn't be hard to add.

@Haacked Haacked added the feature label Aug 6, 2015

@Haacked

This comment has been minimized.

Show comment
Hide comment
@Haacked

Haacked Aug 6, 2015

Member

How often do you think you'd use that?

Member

Haacked commented Aug 6, 2015

How often do you think you'd use that?

@vorou

This comment has been minimized.

Show comment
Hide comment
@vorou

vorou Aug 6, 2015

+1
It's not mission-critical, but I'm sure I feel sad at least twice a week because I have to open the browser and open the site and copy-paste stuff and then copy link. Oh god, it's even more painful now when I described that.

vorou commented Aug 6, 2015

+1
It's not mission-critical, but I'm sure I feel sad at least twice a week because I have to open the browser and open the site and copy-paste stuff and then copy link. Oh god, it's even more painful now when I described that.

@Haacked

This comment has been minimized.

Show comment
Hide comment
@Haacked

Haacked Aug 6, 2015

Member

I think we have some code for doing this laying around even. We had implemented this in GitHub for Windows and then removed it because it was so undiscoverable. We relied on a keyboard shortcut.

Would would be nice is if we could inject ourselves in the context menu when you select a snippet of text in the Visual Studio editor. I'm not sure if that's possible.

Alternatively, we could add a menu to Create Gist from Selection. We should think through the user experience before setting to work on it.

Member

Haacked commented Aug 6, 2015

I think we have some code for doing this laying around even. We had implemented this in GitHub for Windows and then removed it because it was so undiscoverable. We relied on a keyboard shortcut.

Would would be nice is if we could inject ourselves in the context menu when you select a snippet of text in the Visual Studio editor. I'm not sure if that's possible.

Alternatively, we could add a menu to Create Gist from Selection. We should think through the user experience before setting to work on it.

@tkirill

This comment has been minimized.

Show comment
Hide comment
@tkirill

tkirill Aug 7, 2015

Contributor

How often do you think you'd use that?

Regulary, but not very often.

We should think through the user experience before setting to work on it.

Both options are fine for me as long as I can reach them with keyboard. Context menu may be more intuitive though.

Contributor

tkirill commented Aug 7, 2015

How often do you think you'd use that?

Regulary, but not very often.

We should think through the user experience before setting to work on it.

Both options are fine for me as long as I can reach them with keyboard. Context menu may be more intuitive though.

@shana shana added this to the 1.2 milestone Aug 13, 2015

@shana shana added the help wanted label Aug 13, 2015

@shana

This comment has been minimized.

Show comment
Hide comment
@shana

shana Aug 13, 2015

Collaborator

Notes for help-wanted label

This is a nice small feature that could be very interesting for someone wanting to contribute to the project! If you'd like to tackle this (hurrah!), here are the steps that should go into making it happen:

  • Define the User Experience for the feature
    • How would users go about using it? Context menus? Keyboard shortcuts? Action tags? What is the discoverability path for it?
    • Mockup the flow of the experience - what happens from the point where a user wants to create a gist to the point where the action is completed. Does it popup a window? Show a notification? A dialog? What options would there be for creating the gist, if any? Is it a one-click thing or a more complex flow? Does the feature need user settings or configurations?
  • Implement!
    • Fork and create a branch for the feature, and create a PR for the branch. You build the PR over time as you implement things, and practical implementation discussions happen there!
  • 🚢
Collaborator

shana commented Aug 13, 2015

Notes for help-wanted label

This is a nice small feature that could be very interesting for someone wanting to contribute to the project! If you'd like to tackle this (hurrah!), here are the steps that should go into making it happen:

  • Define the User Experience for the feature
    • How would users go about using it? Context menus? Keyboard shortcuts? Action tags? What is the discoverability path for it?
    • Mockup the flow of the experience - what happens from the point where a user wants to create a gist to the point where the action is completed. Does it popup a window? Show a notification? A dialog? What options would there be for creating the gist, if any? Is it a one-click thing or a more complex flow? Does the feature need user settings or configurations?
  • Implement!
    • Fork and create a branch for the feature, and create a PR for the branch. You build the PR over time as you implement things, and practical implementation discussions happen there!
  • 🚢
@ChristopherHackett

This comment has been minimized.

Show comment
Hide comment
@ChristopherHackett

ChristopherHackett Aug 17, 2015

Thinking about the process to create a gist from code in the editor

Select code
Ctrl + C
Ctrl + Tab (until browser)
Ctrl + T 
Start typing 'gist' and hit return when http://gist.github.com appears 
Name gist and hit tab
Ctrl + V
Review code doesn't contain sensitive information 
Mouse to 'Create secret gist' or 'Create public gist' 
Select URL
Ctrl + C
Ctrl + Tab (until in email, IM or other communication tool)
Ctrl + V 

Some observations

  • There is definitely a need for the text been gist-ed to be reviewed before been sent to GitHub.
    • Code and text is leaving the users control. There must be a way to abort in the event of incorrect invocation.
    • On creating a gist via the API you need to specify if it is public or private. Also any future redaction by default will remain in the history of the gist!
  • Users are using gist to share something
    • The last point should make it simple to get the URL of the gist
    • What about services like bl.ocks and Neo4j GraphGist which auto wrap gists into a more useful formats. Should users be able to enable/add these types of third party services?

Anyone want to add any more observations/comments before starting on the new experience?

Thinking about the process to create a gist from code in the editor

Select code
Ctrl + C
Ctrl + Tab (until browser)
Ctrl + T 
Start typing 'gist' and hit return when http://gist.github.com appears 
Name gist and hit tab
Ctrl + V
Review code doesn't contain sensitive information 
Mouse to 'Create secret gist' or 'Create public gist' 
Select URL
Ctrl + C
Ctrl + Tab (until in email, IM or other communication tool)
Ctrl + V 

Some observations

  • There is definitely a need for the text been gist-ed to be reviewed before been sent to GitHub.
    • Code and text is leaving the users control. There must be a way to abort in the event of incorrect invocation.
    • On creating a gist via the API you need to specify if it is public or private. Also any future redaction by default will remain in the history of the gist!
  • Users are using gist to share something
    • The last point should make it simple to get the URL of the gist
    • What about services like bl.ocks and Neo4j GraphGist which auto wrap gists into a more useful formats. Should users be able to enable/add these types of third party services?

Anyone want to add any more observations/comments before starting on the new experience?

@vorou

This comment has been minimized.

Show comment
Hide comment
@vorou

vorou Aug 18, 2015

Would be cool to have as few clicks as possible. I believe it's OK if in first version it just creates private gists without asking. It's the main reason why you need such kind of extension — most of the time you just want to show the code to teammate(s), not to create some useful peace of wisdom.

I agree, preview is a must.

So, to me it looks like this:

  1. Highlight the code.
  2. Click/press «Gist it».
  3. Preview (right in the editor, probably).
  4. «The gist url was copied to the clipboard» balloon appears.

vorou commented Aug 18, 2015

Would be cool to have as few clicks as possible. I believe it's OK if in first version it just creates private gists without asking. It's the main reason why you need such kind of extension — most of the time you just want to show the code to teammate(s), not to create some useful peace of wisdom.

I agree, preview is a must.

So, to me it looks like this:

  1. Highlight the code.
  2. Click/press «Gist it».
  3. Preview (right in the editor, probably).
  4. «The gist url was copied to the clipboard» balloon appears.
@shana

This comment has been minimized.

Show comment
Hide comment
@shana

shana Aug 18, 2015

Collaborator

For a first version, it's fine (and preferable!) if the experience be kept as simple as possible. We can always add more features and options later.

  1. Highlight the code.
  2. Click/press «Gist it».
  3. Preview (right in the editor, probably).
  4. «The gist url was copied to the clipboard» balloon appears.

This feels like a good first approach.

Collaborator

shana commented Aug 18, 2015

For a first version, it's fine (and preferable!) if the experience be kept as simple as possible. We can always add more features and options later.

  1. Highlight the code.
  2. Click/press «Gist it».
  3. Preview (right in the editor, probably).
  4. «The gist url was copied to the clipboard» balloon appears.

This feels like a good first approach.

@tkirill

This comment has been minimized.

Show comment
Hide comment
@tkirill

tkirill Aug 19, 2015

Contributor

Anyone want to add any more observations/comments before starting on the new experience?

I looked at how integration with Gist implemented in Intellij IDEA.

How would users go about using it? Context menus? Keyboard shortcuts? Action tags? What is the discoverability path for it?

I think it is true that many people use mouse for highlighting. So the context menu which opens by right click looks good for "Gist it" command. Intellij IDEA implements Gist support in such way so this is time-proven.

About preview. I already know and I see what code will be in the gist -- it is highlighted by me a moment ago. As for me the preview is not necessary. Also, IDEA doesn't have it and there are no requests for it.

This feels like a good first approach.

Yeah 👍

Contributor

tkirill commented Aug 19, 2015

Anyone want to add any more observations/comments before starting on the new experience?

I looked at how integration with Gist implemented in Intellij IDEA.

How would users go about using it? Context menus? Keyboard shortcuts? Action tags? What is the discoverability path for it?

I think it is true that many people use mouse for highlighting. So the context menu which opens by right click looks good for "Gist it" command. Intellij IDEA implements Gist support in such way so this is time-proven.

About preview. I already know and I see what code will be in the gist -- it is highlighted by me a moment ago. As for me the preview is not necessary. Also, IDEA doesn't have it and there are no requests for it.

This feels like a good first approach.

Yeah 👍

@SamirHafez

This comment has been minimized.

Show comment
Hide comment
@SamirHafez

SamirHafez Aug 20, 2015

I actually tried to do this one a while back and couldn't get past adding the VSCT entry :D

I actually tried to do this one a while back and couldn't get past adding the VSCT entry :D

@DoCode

This comment has been minimized.

Show comment
Hide comment
@DoCode

DoCode Oct 27, 2015

👍
come on guys

DoCode commented Oct 27, 2015

👍
come on guys

@jpobst

This comment has been minimized.

Show comment
Hide comment
@jpobst

jpobst Nov 18, 2015

If anyone wants to tackle this and needs a starting point, I committed some old code I had laying around. It shows you how to add the context menu item and then retrieve the selected text (or whole file) from the code editor.

After that you would need to hook into the existing GHVS infrastructure to submit the gist, as well as any UI you want to display.

https://github.com/jpobst/GistPaste/blob/master/GistPaste/PasteToGistCommand.cs

jpobst commented Nov 18, 2015

If anyone wants to tackle this and needs a starting point, I committed some old code I had laying around. It shows you how to add the context menu item and then retrieve the selected text (or whole file) from the code editor.

After that you would need to hook into the existing GHVS infrastructure to submit the gist, as well as any UI you want to display.

https://github.com/jpobst/GistPaste/blob/master/GistPaste/PasteToGistCommand.cs

@shana

This comment has been minimized.

Show comment
Hide comment
@shana

shana Nov 18, 2015

Collaborator

@jpobst Nice! 😄

Collaborator

shana commented Nov 18, 2015

@jpobst Nice! 😄

@shana

This comment has been minimized.

Show comment
Hide comment
@shana

shana Nov 24, 2015

Collaborator

BTW, there's already code in place to handle menus and commands. The package adds context menus in the "Connections" area like this - https://github.com/github/VisualStudio/blob/master/src/GitHub.VisualStudio/GitHubPackage.cs#L51

Collaborator

shana commented Nov 24, 2015

BTW, there's already code in place to handle menus and commands. The package adds context menus in the "Connections" area like this - https://github.com/github/VisualStudio/blob/master/src/GitHub.VisualStudio/GitHubPackage.cs#L51

georgebearden pushed a commit to georgebearden/VisualStudio that referenced this issue Nov 25, 2015

@shana shana modified the milestones: 1.1 - Pull Requests (and more), 1.0.17.0 - Gists and Links May 26, 2016

@shana shana referenced this issue Jun 6, 2016

Merged

Feature: Gist support #194

3 of 3 tasks complete
@grokys

This comment has been minimized.

Show comment
Hide comment
@grokys

grokys Jun 15, 2016

Contributor

This has now landed in master!

Contributor

grokys commented Jun 15, 2016

This has now landed in master!

@grokys grokys closed this Jun 15, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment