#OpenToWork Available for new opportunities! Let's build something amazing together.

Get in touch

Archive for 2022

archy

Creating timer dismissable notifications in a Visual Studio Code extension

Notifications in Visual Studio Code are trivial for your extensions to notify the user when something happens or a process completes. A downside of these notifications is that they cannot be dismissed programmatically; they require manual user interaction. As in my current extension, I wanted to be able to have a notification that can do the following:

Read more

Cancel progress programmatically in Visual Studio Code extensions

With the Visual Studio Code progress notification (vscode.window.withProgress), you can make it cancellable. This cancellable option allows the user to cancel it by clicking on a cancel button. Show image Progress notification in Visual Studio Code What if you want to cancel it programmatically? That was the case for one of my extensions.

Read more

Make your authentication provider work in GitHub and Gitpod codespaces

In the previous article, I explained how you could ensure your URI handler works in GitHub codespaces and Gitpod. Now it is time to explain more about making an authentication provider that works on GitHub codespaces and Gitpod. The authentication flow In the extension I am working on, we use the OAuth 2.

Read more

#DevHack: using the Visual Studio Code's URI Handler in codespaces

If you are reading this article, you know what a URI handler in Visual Studio Code is, but in case you do not. A URI Handler allows you to create a callback into your extension. Typically this is used in authentication flows to open your browser, fill in your credentials, and get redirected back into Visual Studio Code.

Read more

Migrate from Disqus to GitHub Discussions (giscus)

For years I have been using Disqus on my blog, and for a long time, I have been looking for a good alternative that would fit into the daily tools. Another reason why I wanted to move away from Disqus is because of their tracking and ads. A long time ago, I looked at utterances, a commenting system based on GitHub issues.

Read more

Calling the GitHub GraphQL API from an app

For a migration from Disqus over to GitHub Discussions, I created a script that processes all comments and replies. One thing I noticed is that I quickly reached the rate limit with my personal access token, which prevents me from using GitHub for a while. I decided to use a GitHub App to overcome the issue of locking out my account.

Read more

Finding your old GitHub Codespaces and deleting them

Over the weekend, I received a couple of emails I was running out of GitHub Codespaces storage. My limit is 20GB, but more interesting is that I rarely use codespaces. Show image GitHub Codespaces storage usage The last time I used Codespaces was about a year ago, but I couldn’t remember which repository it was.

Read more

Someone is DDoS-ing my Azure Functions, and here is what you can do

Last week, all of a sudden, my Azure subscription got suspended. As the subscription runs on credits and is optimized to be way below the limit, I was surprised to see that I suddenly reached the spending limit. Usually, the monthly cost for the subscription is around 50-60 EUR. This month, it suddenly got above 150 EUR, but why?

Read more

The story of buying a car and what went wrong with it

Let us go back to the end of 2020. My wife and I were chatting in the kitchen about buying a new car. One of the criteria of my wife the vehicle should have was to have seven seats as it would be easier to bring kids to tennis. I wanted to go for a fully electric car.

Read more

Simplify Visual Studio Code extension webview communication

In Visual Studio Code extension webviews you probably need to get familiar with post-messaging communication. This post-messaging communication is used when you want to start a process, request information, etc. For this communication flow to work, the extension and webview can send and listen to incoming messages. Although this is not a complicated flow to understand, it quickly feels like a disconnected communication flow, as you cannot simply wait for a response.

Read more

Creating a reusable auth provider in Visual Studio Code

A couple of months ago, I wrote about how you could create an authentication provider for Visual Studio Code. In this article, we will take it further and make it reusable by other extensions. The reason for creating a reusable authentication provider could differ per solution. Maybe you want to make one for other extensions to leverage, or your company wants to release multiple extensions that can all use the same type of authentication.

Read more

Adding editor actions for your extension webview in Visual Studio Code

In Visual Studio Code extension development, you may need a webview to give the developer/user the best experience for using your extension/functionalities. Webviews come in different flavors. You can open them in a panel or an editor view, but there is a difference between both when it comes to showing actions or enabling/disabling commands.

Read more

Open your Visual Studio Code extension walkthrough from a command

A great feature that allows your users to get familiar with your extension is the ability for you to create walkthroughs. Show image Walkthrough experience The welcome experience can be seen or opened from the start experience in VS Code. Show image VS Code - Get started But how do you get to the welcome experience when you close the start page?

Read more

Opening folders in Visual Studio Code from an extension

I used the vscode.openFolder command in one of my extensions, one of the built-in commands that is available. The command can be combined with a URI argument to open the folder or workspace. While testing it out, the command worked fine on macOS and Linux but gave issues on Windows paths.

Read more

Adding or deleting GitHub project (classic) labels on issues

important This approach makes use of GitHub classic projects and are being discontinued. The approach will not work for new Projects as they require you to use the webhook functionality in order to create Project Item triggers. Since projects got added to GitHub, I started using it more and more.

Read more

How to callback to your extension from outside Visual Studio Code

While creating the authentication provider, I discovered a helpful handler in the Visual Studio Code API, which allows you to handle system-wide URIs and callback into your extension. In the case of the authentication provider, I use it to retrieve the token that gets passed from the callback, but you can use the registerUriHandler for many more scenarios.

Read more

Create an Authentication Provider for Visual Studio Code

Previously I wrote how you could use the Microsoft Authentication Provider in your Visual Studio Code extension to custom Azure AD applications. In this article, we go a step further and create our authentication provider from scratch. As By default, VS Code supports the github, github-enterprise, and microsoft authentication providers. If you use another service or have your authentication service, you will likely want to create your Authentication Provider.

Read more

How to use the Microsoft authentication provider in Visual Studio Code

While creating a custom authentication provider, I found out the standard Microsoft authentication provider in Visual Studio Code can be used with your Azure AD Apps and Tenants. By default, VS Code supports the github, github-enterprise, and microsoft authentication providers, but little documentation is available, mostly coming from the issues in the VS Code repo.

Read more

Extension tip to bring Visual Studio Code to the foreground

In one of the extensions I am developing with a custom authentication provider, I required to bring the last Visual Studio Code instance to the front once signed in. When you can control the full authentication flow, you typically redirect the user to vscode://..., which triggers your browser from opening Visual Studio Code.

Read more

#DevHack: Fetching sponsors via the GitHub GraphQL API

To automate the roll-up of sponsors for Front Matter on the website. I started to look through the GitHub Rest API documentation to check it could receive this kind of information. Unfortunately, the Rest API does not provide you with this information, so I went to where the cool kids go these days, GraphQL.

Read more

#DevHack: VS Code extension storage options

For Front Matter and another VS Code extension which is currently in development, I wanted to understand which options there are for storing data. Data can be anything, for some extensions, it will be settings, for others, it is more complicated sets of data. In this article, I will give you an overview of all the available storage options and when to use them.

Read more

A code-driven approach to theme your VS Code webview

When it comes to theming the webview’s content of your Visual Studio Code extensions, the proposed way by the Visual Studio Code team is to use the provided CSS variables from the current theme. Although, in some cases, you want a bit more control, or make sure it matches what you want to achieve.

Read more
Back to top