Nicolas Carlo
Let's build a VS Code extension for automated refactorings
#1about 10 minutes
Scaffolding your first VS Code extension project
Use the Yeoman generator (`yo code`) to quickly create the boilerplate for a new TypeScript-based VS Code extension.
#2about 6 minutes
Running and debugging your first extension
Explore the generated project structure, including `package.json` contributions and the `extension.ts` activation file, then run it in the Extension Development Host.
#3about 10 minutes
Reading and writing code using the VS Code API
Access the active editor's content using `window.activeTextEditor` and modify it programmatically with `editor.edit()`, then add a keybinding for quick access.
#4about 13 minutes
Manipulating code reliably with Abstract Syntax Trees
Overcome the limitations of string manipulation by using Babel to parse code into an Abstract Syntax Tree (AST), traverse it, and generate transformed code.
#5about 7 minutes
Understanding the principles of safe automated refactoring
Learn Martin Fowler's definition of refactoring and see how automating small, behavior-preserving changes like "introduce guard clauses" improves code quality.
#6about 15 minutes
Test-driving the refactoring logic with Mocha
Set up an isolated testing environment with Mocha to test the pure transformation logic, enabling a fast feedback loop with Test-Driven Development (TDD).
#7about 23 minutes
Implementing the refactoring using AST manipulation
Write the logic to identify and transform a nested `if` statement into a guard clause by manipulating its AST nodes and handling different code patterns.
#8about 1 minute
Packaging and publishing your VS Code extension
Use the `vsce` command-line tool to package your extension into a `.vsix` file for private sharing or for publishing to the official VS Code Marketplace.
#9about 6 minutes
Recap and resources for advanced extension development
Review the key steps for building an extension and explore advanced topics like hexagonal architecture for testing and contributing to open-source projects.
#10about 8 minutes
Q&A on extensions, testing, and development tools
The speaker answers audience questions about the VS Code extension ecosystem, security concerns, testing strategies, and using tools like GitHub Copilot.
Related jobs
Jobs that call for the skills explored in this talk.
Matching moments
14:59 MIN
Demonstrating a Langium-powered VS Code extension
Langium: Design Your Own Language in Node.js and VS Code
05:12 MIN
Why VS Code's extensibility led to its success
WeAreDevelopers LIVE - Demo Time, Live Coding, End-to-End Testing and more
28:31 MIN
Recap of the four-step JavaScript to TypeScript migration
4 Steps from JavaScript to TypeScript
01:51 MIN
Reframing common complaints about JavaScript development
How to Stop Choosing JavaScript Frameworks and Start Living
00:51 MIN
Defining refactoring and refactorable code
Keep your code refactorable
40:04 MIN
Introducing Demo Time for flawless live coding presentations
WeAreDevelopers LIVE - Demo Time, Live Coding, End-to-End Testing and more
10:26 MIN
A live demonstration of GitHub Copilot in VS Code
How we will build the software of tomorrow
32:12 MIN
Strategies for migrating large codebases to TypeScript
WeAreDevelopers LIVE - Whats Nuxt and Next for app development, 20 years AJAX and more
Featured Partners
Related Videos
4 Steps from JavaScript to TypeScript
Phil Nash
Vulnerable VS Code extensions are now at your front door
Raul Onitza-Klugman & Kirill Efimov
Keep your code refactorable
Gerrit Stapper
Do TypeScript without TypeScript
Simone Sanfratello
Making Sense of Programming Languages
Aleksandra Sikora
Vue3 practical development
Mikhail Kuznetcov
WeAreDevelopers LIVE - Demo Time, Live Coding, End-to-End Testing and more
Chris Heilmann, Daniel Cranney & Elio Struyf
Extensionator - Rise of the Chromium
Keren Kenzi
Related Articles
View all articles



From learning to earning
Jobs that call for the skills explored in this talk.

Senior Full Stack Web Developer:in (w/m/d)
Lotum media GmbH
Bad Nauheim, Germany
Senior
Node.js
JavaScript
TypeScript

Senior Frontend Developer - Typescript / Svelte - (f/m/x)
doinstruct Software GmbH
Berlin, Germany
Senior
GIT
JavaScript
TypeScript


Senior Angular Developer (m/w/d)
autoiXpert GmbH & Co. KG
Stuttgart, Germany
Senior
Node.js
Angular
MongoDB
TypeScript



Développeur·se Full Stack JS/TypeScript IA
Devoteam
MySQL
DevOps
Node.js
TypeScript
Continuous Integration


Node.js/Playwright Engineer - Testdriver Development
TechBiz Global GmbH
Mons, Belgium
Remote
Docker
Node.js
Continuous Integration