My VS Code Extension
A sample VS Code extension demonstrating basic functionality.
Features
- Adds a "Hello World" command
- Shows a status bar item
- Includes error handling
- Comes with test setup
Development
Setup
- Clone the repository
- Run
npm install
- Open in VS Code
- Press F5 to start debugging
Project Structure
├── src/
│ ├── extension.ts # Extension entry point
│ ├── commands.ts # Command implementations
│ ├── statusBar.ts # Status bar management
│ ├── utils/ # Utility functions
│ └── test/ # Test files
├── .vscode/ # VS Code specific files
├── package.json # Extension manifest
└── tsconfig.json # TypeScript configuration
Available Commands
npm run compile : Compile the extension
npm run watch : Compile and watch for changes
npm run test : Run tests
npm run lint : Lint the code
Debugging
- Open the project in VS Code
- Press F5 to start debugging
- A new VS Code window will open with the extension loaded
- Use Command Palette (Ctrl+Shift+P) and type "Hello World" to test the command
Testing
Run tests using:
npm run test
Publishing
To package the extension:
- Install vsce:
npm install -g vsce
- Run:
vsce package
- Visit and Upload package:
https://marketplace.visualstudio.com/manage/publishers
This will create a .vsix file that can be installed in VS Code.
License
MIT
| |