Visual Studio extension to manage your Github gists

Akos Nagy
Mar 20, 2019

There are a couple of extensions available in the Visual Studio Marketplace to handle your Github gists — and not to belittle others, but I have to admit, I didn't like any of them. They are not intuitive or comfortable to use or lack features. What I wanted was a complete, easy-to-use solution that lets users manage gists: create, delete, checkout versions, import, search etc.

So I put my mind to creating an extension like this. And here it is :) If you want, you can go ahead and download the extension from the marketplace here. If you are interested in the making of the extension, read on.

A full-featured extension to manage your gists

List and search your private and public gists:

Use drag-and-drop to create gists or add gistfiles to an already existing gist:

Use drag-and-drop to drop the contents of a gistfile to the Visual Studio editor:

Rename gist files:

Manage your gists: copy URL to clipboard, delete or checkout an earlier version of the gist:

Manage gistfiles: copy the raw URL of the file, delete the file or checkout an earlier version of the file:

Creating the extension

The extension took some time to create and involves a lot of code, so I'm not going to discuss the details here. If you are interested, you can check out the source code on Github. But I did have a great time and experimented with a couple of cool things:

  • To implement the Github OAuth login, I used the new (not-so-old) WebView. While it does lack some features, it is very good to see that we now have access to the HTML, CSS and JavaScript of Edge.
  • Using dependency injection for a Visual Studio extension. This was fun :) I have already done a separate post on this topic.
  • An editable treeview. I was shocked to see that this is still not part of WPF. I had to scour the internet and found a lot of samples; some of which worked and some of which didn't. I finally found one that I could at least use as a starting point for my own; check out the source to see more.
  • Got to use my Func<> based equality comparer again :)
  • I did a lot of reading about the possibilities and architectural guidelines of executing commands asynchronously. To see what I have come up with, check out the source code. To get started, I suggest you check out the articles and code by Stephen Cleary.

I honestly hope that this will catch on and a lot of you will end up using it. I tried to strive for an all-inclusive and easy-to-use solutions. If you have any ideas, feel free to create an issue or submit a PR on the projects Github repo.

Akos Nagy
Posted in Visual Studio