Extensions

#DevHack: VS Code extension storage options

February 22, 2022

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

January 31, 2022

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

Use React in your VSCode WebView with hot module replacement

December 17, 2021

For Front Matter and another extension, I am currently developing. I use the Visual Studio Code WebView API heavily as it provides fully customizable views for your panels or tabs. It allows any company and developer to create their own unique experiences. One of the things I did for a long time was manually hitting the refresh button each time I updated the code.

Read more

#DevHack: check how your VSCode extension is running

December 17, 2021

When developing Visual Studio Code extensions, it might come in handy to know when running a production- or debug-build. Typically in Node.js projects, we verify this by using the NODE_ENV environment variable. Unfortunately, this approach cannot be used as VS Code runs in a different instance, and environment variables are lost.

Read more

#DevHack: language-specific settings in a VSCode extension

August 18, 2021

When working with Visual Studio Code and different types of languages, you might want to change some settings only for one specific language. In my case, this was what I wanted to achieve for Markdown. VSCode is my primary editor, which I use for coding and writing this article. I tried to optimize it for writing blog posts, like increase the line height, different font, and more.

Read more

#DevHack: How to rename a file from a VSCode extension

August 16, 2021

Renaming a file is something that we do very often, but in my case, I wanted to do it from within a Visual Studio Code extension. When I first looked at the APIs and available documentation, I found the vscode.executeDocumentRenameProvider command and RenameProvider. Info Documentation from this can be found here built-in commands.

Read more