Skip to main content

Development Environment Setup

VS Code provides a comprehensive development environment with pre-configured tasks, launch configurations, and tooling.

Editor Configuration

The repository includes VS Code workspace settings optimized for development:

TypeScript

  • Tabs for indentation (not spaces)
  • Real-time compilation feedback
  • Strict type checking enabled

Tasks

  • Pre-configured build tasks
  • Watch mode tasks
  • Test runner tasks

Extensions

  • ESLint integration
  • TypeScript language features
  • Debug adapters

Launch Configs

  • Multiple debug configurations
  • Compound launch setups
  • Test runner integrations

Architecture Overview

Understanding the codebase structure is essential for effective development:

Core Source Structure (src/)

src/vs/base/ - Foundation utilities and cross-platform abstractions
  • Common data structures (arrays, maps, events)
  • Platform-agnostic utilities
  • Basic UI components
  • No dependencies on other VS Code layers

Built-in Extensions

The extensions/ directory contains first-party extensions:
  • Language features: typescript-language-features/, html-language-features/, css-language-features/
  • Core features: git/, debug-auto-launch/, emmet/, markdown-language-features/
  • Themes: theme-* folders
  • Development tools: extension-editing/, vscode-api-tests/

Coding Guidelines

Following these guidelines is mandatory for all code contributions. The CI/CD pipeline enforces many of these rules.

Naming Conventions

Indentation and Style

VS Code uses tabs, not spaces for indentation. This is enforced by ESLint.

String Handling

UI Labels

Use title-style capitalization for UI elements:

Code Quality Requirements

1

TypeScript Strictness

  • No any or unknown without justification
  • Proper type annotations required
  • Define interfaces for complex types
2

Async/Await

Prefer async/await over Promises:
3

Disposables

Critical: Always handle disposables properly to avoid memory leaks:
4

Code Reuse

Always search for existing utilities before implementing new ones:

Development Tasks

Compilation and Building

Code Quality Checks

Run these checks before committing:
1

TypeScript Compilation

Check for compilation errors:
Monitor the watch task output for real-time errors:
2

Layer Validation

Ensure architectural layers are respected:
3

Linting

Run ESLint and StyleLint:
4

Hygiene Check

Run all code hygiene checks:
Or use the precommit hook:

Specialized Compilation Checks

Working with Extensions

Building Extensions

Downloading Built-in Extensions

Some extensions are not included in the repository:

Updating Dependencies

Grammar Updates

Update language grammars:

Localization

Update localization extension:

TypeScript Version

Update to latest TypeScript:

Performance Testing

Run performance benchmarks:

Common Development Workflows

Feature Development

1

Start Watch Mode

2

Run VS Code

Launch VS Code with debugger attached (F5 in VS Code) or:
3

Make Changes

Edit TypeScript files - they’ll automatically recompile
4

Reload Window

In the running VS Code instance:
  • Press Cmd/Ctrl + R to reload
  • Or use Command Palette: “Developer: Reload Window”
5

Run Tests

Test your changes:

Bug Fixing Workflow

1

Find Related Code

  1. Use semantic search for general concepts (Glob tool)
  2. Use grep for exact strings/error messages
  3. Follow imports to understand dependencies
  4. Check test files for usage patterns
2

Debug the Issue

Launch VS Code with debugger (see Debugging)
3

Implement Fix

Make changes following coding guidelines
4

Validate

CI/CD Integration

The repository includes CI/CD scripts:

Tips and Best Practices

Always develop with watch mode running (npm run watch) for instant feedback on TypeScript errors.
Use the pre-configured launch configurations in .vscode/launch.json for debugging different processes:
  • Main Process
  • Extension Host
  • Shared Process
  • Search Process
Before importing from another module, verify it’s allowed by the layer architecture:
Run relevant tests frequently during development:
If you encounter strange issues, try a clean build:

Next Steps

Debugging

Learn how to debug VS Code itself

Running Tests

Understand the testing infrastructure

Building from Source

Review build instructions

How to Contribute

Read the full contribution guide