Skip to content

Sangram03/workwave

Repository files navigation

Step-by-Step Guide to Create a VS Code Extension

1. Install Prerequisites

Install:

Verify installation:

node -v
npm -v

2. Install Yeoman and VS Code Extension Generator

npm install -g yo generator-code

Verify:

yo --version

3. Create a New Extension Project

yo code

Select:

? What type of extension do you want to create?
> New Extension (TypeScript)

Fill in:

Extension Name: workwave
Identifier: workwave
Description: Productivity extension for VS Code

4. Open the Project

cd workwave
code .

5. Understand the Project Structure

workwave/
│
├── src/
│   └── extension.ts
├── package.json
├── README.md
├── tsconfig.json
└── .vscode/

6. Add Your First Command

Open:

src/extension.ts

Replace the activate function with:

import * as vscode from 'vscode';

export function activate(context: vscode.ExtensionContext) {

    let disposable = vscode.commands.registerCommand(
        'workwave.helloWorld',
        () => {
            vscode.window.showInformationMessage(
                'Hello from WorkWave!'
            );
        }
    );

    context.subscriptions.push(disposable);
}

export function deactivate() {}

7. Register the Command

Open:

package.json

Inside contributes:

"commands": [
  {
    "command": "workwave.helloWorld",
    "title": "WorkWave: Hello World"
  }
]

8. Run the Extension

Press:

F5

A new Extension Development Host window opens.

Open Command Palette:

Ctrl + Shift + P

Run:

WorkWave: Hello World

You should see:

Hello from WorkWave!

9. Build the Extension

npm install
npm run compile

10. Package the Extension

Install VSCE:

npm install -g @vscode/vsce

Package:

vsce package

Output:

workwave-0.0.1.vsix

Running:

vsce package

---

### 11. Install the VSIX

```bash
code --install-extension workwave-0.0.1.vsix

or in VS Code:

Extensions → ⋯ → Install from VSIX

12. Publish to Marketplace

Create a publisher account at:

Visual Studio Marketplace

Login:

vsce login <publisher-name>

Publish:

vsce publish

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors