Creating a Submenu in VS Code: A Step-by-Step Guide
Elio Struyf
by Elio Struyf
4d ago
While creating a session about Visual Studio Code extension development, I discovered that creating a submenu in the context menus is possible. These submenus are a great way to make the context menus less cluttered and easier to use. Submenu in a context menu When trying it out, I could not make it work easily as the docs were unclear. So I decided to write this article to help others who want to create a submenu in their Visual Studio Code context menus. Creating the submenu Creating a submenu starts with the package.json file (extension manifest) at the root of your extension. Add a submen ..read more
Visit website
Creating timer dismissable notifications in VS Code
Elio Struyf
by Elio Struyf
1M ago
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: Show notification with an undo button; Hide the notification after 10 seconds; If you click on the undo action, hide the notification needs to be removed. You might think it should be easy, but unfortunately, it is not the case. In the above r ..read more
Visit website
The doubts, the achievements, and the progress. 2022 wrap-up
Elio Struyf
by Elio Struyf
1M ago
Less than two weeks, and we are ending the year 2022. It was an intense year personally, but there was also a lot of progress and a couple of achievements, of which I am happy and proud. In life, you make choices that you believe are the right ones, but they strike you in the end. It probably happens to all of us, but I was not expecting this myself. So lesson learned; the next step is to accept it and move on. Besides bad choices, I made a couple of good ones. A couple of these turned out well. My vertebrae A couple of weeks ago, at the ESPC. A lot of people were asking me about my progress w ..read more
Visit website
Make your auth provider work in GitHub and Gitpod codespaces
Elio Struyf
by Elio Struyf
1M ago
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.0 Authorization Code with PKCE flow, which is the recommended flow to use as it improves the security of the callback. The high-level flow looks as follows: Visual Studio Code - Authentication flow On step number 1, the user gets redirected to the browser (or a new browser tab if opened from ..read more
Visit website
#DevHack: using the VSCode's URI Handler in codespaces
Elio Struyf
by Elio Struyf
1M ago
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. Your URI Handler will then process the rest of the authentication process, like requesting an access token. While working on a custom authentication provider, I found it needed to be fixed for GitHub Codespaces and Gitpod. The URI Handler, configured in my Visual Studio Code ex ..read more
Visit website
Migrate from Disqus to GitHub Discussions (giscus)
Elio Struyf
by Elio Struyf
2M ago
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. Although it sounded perfect, I found it not ideal for a long time. GitHub issues do not provide a threaded way of communication, so for a commenting system, it would be weird. Although, a week ago, I thought to give it a try. While preparing for the migration, I did one last ..read more
Visit website
Finding your old GitHub Codespaces and deleting them
Elio Struyf
by Elio Struyf
2M ago
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. GitHub Codespaces storage usage The last time I used Codespaces was about a year ago, but I couldn’t remember which repository it was. I tried to check a couple of repositories but without success. When reaching out to GitHub and following the documentation, I found out how to best find all of your old Codespace instances. info Viewing your GitHub Codespaces usage Finding your old Codespaces To find your old Codespaces, you m ..read more
Visit website
The story of buying a car and what went wrong with it
Elio Struyf
by Elio Struyf
3M ago
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. As a couple of my friends drive a Tesla, and they were optimistic about it, we went to order a Tesla Model X beginning of February 2021. The delivery date was set to September 2021, which was just perfect. A couple of weeks go by, and all of a sudden, there is a virus that overtakes the world. That is when we got our first call f ..read more
Visit website
Simplify Visual Studio Code extension webview communication
Elio Struyf
by Elio Struyf
4M ago
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. To understand this “disconnected” communication flow better, let us take the following example: Once I open the webview, I want t ..read more
Visit website
Creating a reusable auth provider in Visual Studio Code
Elio Struyf
by Elio Struyf
4M ago
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. For me, the lather is why I created a reusable authentication provider. Instead of creating an auth provider for each extension we make, we wanted to create ..read more
Visit website

Follow Elio Struyf on Feedspot

Continue with Google
OR