Search code examples
githubvisual-studio-codegist

Setup Gist extension for VS Code


I'm trying to use the Gist extension for VS Code.

I did the following steps:

  • Install extension
  • GIST: select profile
  • Create New Profile -> Github.com (common)
  • On Github, I created a new access token, then I copied the token and I pasted it on VS Code

When I do GIST: open gist I have no gist in the list, but on Github I have 3 secret gists.

Why? What am I doing wrong?


Solution

  • 1st, make sure that when you created the access token on Github, you enabled the gist access:

    https://github.com/settings/tokens/new:
    enter image description here

    (If you haven't created an access token or you want to make sure you created it properly, see Github's docs on Creating a personal access token).

    The extension does not raise an error if the token you created and pasted does not have gist access, but when you do "GIST: Open Gist", the list will show up as empty.

    2nd, the extension seems to only support owned gists, meaning gists you created under the same account as the access token. It does not include starred or favorited ones. You can check by going to your https://gist.github.com/[username], and selecting the All gists tab. Only those under that tab will be fetched by the VS Code extension.

    There was an issue "Feature - Open Starred Gists" and a PR "feat: adds open favorite" opened by the author himself, but as of 3.0.3 that I am using now, my favorited/starred gists still don't show up.