Comments (17)
Not today, but it wouldn't be hard to add.
from visualstudio.
How often do you think you'd use that?
from visualstudio.
+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.
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.
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.
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.
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.
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:
- Highlight the code.
- Click/press «Gist it».
- Preview (right in the editor, probably).
- «The gist url was copied to the clipboard» balloon appears.
from visualstudio.
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.
- Highlight the code.
- Click/press «Gist it».
- Preview (right in the editor, probably).
- «The gist url was copied to the clipboard» balloon appears.
This feels like a good first approach.
from visualstudio.
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.
I actually tried to do this one a while back and couldn't get past adding the VSCT entry :D
from visualstudio.
👍
come on guys
from visualstudio.
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.
@jpobst Nice! 😄
from visualstudio.
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.
This has now landed in master!
from visualstudio.
I am constantly sending code from VS to ChatGPT as gists.. hopefully it will get integrated soon.
from visualstudio.
Related Issues (20)
- Unexpected problem
- Commit Changes Button is not Visible while adding .gitignore in My Main Branch, Please Look into this and provide necessary workaround!!
- Tailwind CSS not working on visual studios
- Failed to launch debug adapter - 17.6.0 Preview 1 - Blazor HOT 1
- Bug report
- {! Doctypehtml} HOT 1
- VS Community 2022 RUN and Compile functions aren't available
- A
- QuickWatch Doesn't Have "View" Button For StringBuilder (VS 2022)
- xaml live preivewer is mirrored
- VS 2022 Mac 17.5.4 cannot build project from external ssd
- Documentation re: reviewing github pull requests is out of date
- Slow run times
- Ft
- A repository named "Foo already exists for owner "MyGitHubUser" -- but no, it does not
- Activity 2
- My link
- Add an option/tool to convert selected members of a class to positional record
- New Here
- visual studio docker error: NU1301: Unable to > load the service index for source
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from visualstudio.