Make yourself an vscode extension
October 29, 2025

Overview
Hi, I worked with React Compiler recently, you can find it here. After comparing the render performance, I can see I missed to memoize some cases (lost in the memos). I was thinking it would be nice if any visual tag is attached to the variable which is memoized.
Finding online and could not find any, so why am i not creating one for myself? We will see more about my production in another post, this one will focus only on how can we create and publish an vscode extension to the marketplace.
I'm sure there will be so much such a blog like this for guiding you how to do this, but there will be some struggle that you might occured. This will be the wrapper for the official document
Let's make one together!
Let's start
Initialize the project
Let's start with simple command:
This will open a terminal guide to give you options. In this case, we are doing for Typescript, so they suggested to choode the option as following:
You can see here they are not bundled and use npm:
- Not bundling: It's okay, since we only run with Node.js, no browser run so no need to bundle for optimized.
- using
npm: let's useyarnfor our case.
Try debugigng for the first time
At the left panel, let's click on Run and Debug (or Cmd/Ctrl + Shift + D). From there select Start Debugging (or F5).
The pop up window will have [Extension Development Host], make sure we interact with correct window.
From here, we Cmd/Ctrl + Shift + P, then type Hello World. You should see the option and the popup message with Hello World from Complimentor!.
Small note
But, you might meet the same issue with me. Type Hello World and see nothing.
For deeper research, Option + Cmd/Ctrl + I for opening console, it will throw something like this:
The Code version is imcompatible, go to package.json, update the engine to your equivalent mentioned version, in mine case is 1.96.4:
Now run debug again, you found the Hello World command, and voila!
Take a look inside
Now we have a bunch of new code, what are they, which should I care first?
extension.ts
This is the entry point of your extension.
activate: is everything happened when you activate the extension.vscode.commands.registerCommand('', () => {}): this is action when we toggle the extension by commandCmd + Shift + Pvscode.window.showInformationMessage(): the popup with message you see at the bottom right of the screen
package.json
This is where you set the config for your extension:
This will match with the registerCommand inside extension. Remeber to match exactly 2 texts:
This is when the extension activate (in condition you activate the extension inside marketplace). Empty means when you toggle on, but there will be some aother options:
Let's write some code
The idea behind
We will create an extension, that's like a buddy cheers us up everytime we make change to our code. That's easy, so let's list down the feature:
- When the ide fully loaded, say something like
Let's coding! - Whenever make change and hit save, say some compliment.
- And can give compliment when toggle the command.
Adding features
APIs
We need to check the vscode APIs for checking which one should we use, here. But I'll give you the one we'll use:
vscode.window.activeTextEditor: Whenever the ide is fulle loadedvscode.workspace.onDidSaveTextDocument: Whenever user savevscode.window.showInformationMessage: Show the pop up with messagevscode.commands.registerCommand: Whenever toggle the extension
Adding logics
Inside extension.ts, let's adding an array for the compliments:
Then. for the first feature, we listening for the event then pop it out:
Now go for the save event handler:
You might try:
And this still works! But if we add tocontext.subscriptions, the system will clean up everything for us, instead of hanging event listener even when not needed.
Last one, when the user triggered (this one they give us from the beginning):
So now, if you debug, you hit save, nothing happened. Then when you toggle it, everything works until now. Why?
Adding config
Remember that we have activationEvents": [] at our package.json. As we leave it blank, it will be only triggered when we toggle the extension on. In my case, i want it to be on whenever we start our vscode session, so let's adding this:
Make it global
Everything is done! Let's give the world the chance to use it. We have the tutorial here, but let's still go through together!
Create Azure Devops organization
The given one inside the website makes me misarable for a while, i find someway around but instead im trying this one:
Or you can just follow the tutorial!
Get Personal Access Token
Follow this one:
Create a publisher
Follow this one:
Prelaunch step
We'll use vsce. It stands for Visual Studio Code Extension. You can install it globally with
Then we'll check if our extension qualified for the publish. This is some steps you might need to do now:
- Adjust the
README.mdfile - Publish to Github, then update at
package.json:
- Add the publisher to
package.jsonas the one you just created:
- Add the icon to your extension. Just create a new folder at root and add your icon there. Remember only
.jpgand.pngare supported
Now we go:
It will check, and generated myExtension.vsix if alls good for publishing.
Launch it
Remember to add Personal Access Token for publisher YourPublisherName: here.
Verify the extension
Let's go to the marketplace manager page
then wait a bit for them to verify your extension. Afterward, you will be able to find it at VSCode Marketplace!
Conclusion
It's quite a long post, and I'm glad we can make it here together! I hope you can make yourself one extension, and many more useful one.
By the way, we have this since i created another one for myself, you can find it here. It called MemoMate, the mate for you to
highlight the memoized React component in your repo.
Happy coding, pals!
Table of Contents