Coder Social home page Coder Social logo

Comments (17)

haacked avatar haacked commented on May 24, 2024

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

from visualstudio.

haacked avatar haacked commented on May 24, 2024

How often do you think you'd use that?

from visualstudio.

vorou avatar vorou commented on May 24, 2024

+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.

from visualstudio.

haacked avatar haacked commented on May 24, 2024

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.

from visualstudio.

tkirill avatar tkirill commented on May 24, 2024

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.

from visualstudio.

shana avatar shana commented on May 24, 2024

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!
  • 🚢

from visualstudio.

ChristopherHackett avatar ChristopherHackett commented on May 24, 2024

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?

from visualstudio.

vorou avatar vorou commented on May 24, 2024

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.

from visualstudio.

shana avatar shana commented on May 24, 2024

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.

from visualstudio.

tkirill avatar tkirill commented on May 24, 2024

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 👍

from visualstudio.

SamirHafez avatar SamirHafez commented on May 24, 2024

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

from visualstudio.

DoCode avatar DoCode commented on May 24, 2024

👍
come on guys

from visualstudio.

jpobst avatar jpobst commented on May 24, 2024

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

from visualstudio.

shana avatar shana commented on May 24, 2024

@jpobst Nice! 😄

from visualstudio.

shana avatar shana commented on May 24, 2024

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

from visualstudio.

grokys avatar grokys commented on May 24, 2024

This has now landed in master!

from visualstudio.

cdeisler avatar cdeisler commented on May 24, 2024

I am constantly sending code from VS to ChatGPT as gists.. hopefully it will get integrated soon.

from visualstudio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.