How microsoft/typescript works
TypeScript is a language compiler and tooling platform: users compile JavaScript/TypeScript projects into JavaScript and receive diagnostics, while editors use its language server for interactive features. The map follows the command-line and language-server entry points, the compiler and language-service stages, and the VS Code client. It also includes the public API clients and the extension’s configuration and middleware capabilities. Some relationships are based on the SOURCE INDEX or README rather than complete source excerpts; those evidence limits are reflected in the edges.
Main entry points: session.ts Extension session · program.go Compiler program · main.go CLI entrypoint · client.ts Async API client
Components 24
User entrypoints
- CLI entrypoint
tsc/cmd/tsc/main.go - LSP server
tsc/internal/lsp/server.go
Compilation
- Compiler program
tsc/internal/compiler/program.go - Incremental builds
tsc/internal/execute/incremental/program.go - Watch manager
tsc/internal/execute/watchmanager/watchmanager.go - AST scanner
packages/typescript/src/ast/scanner.ts - Type checker
tsc/internal/checker/services.go
Editor services
- Language service
tsc/internal/ls/languageservice.go
VS Code integration
- Extension session
packages/vscode-typescript/src/session.ts - Language client
packages/vscode-typescript/src/client.ts - Editor commands
packages/vscode-typescript/src/commands.ts - LSP middleware
packages/vscode-typescript/src/lspMiddleware.ts - Content mapping
packages/vscode-typescript/src/contentMapperContributions.ts - Telemetry reporting
packages/vscode-typescript/src/telemetryReporting.ts - SDK selection
packages/vscode-typescript/src/tsdkPackage.ts
Public API
- Async API client
packages/typescript/src/api/async/client.ts - Sync API client
packages/typescript/src/api/sync/client.ts - Filesystem callbacks
packages/typescript/src/api/fsCallbacks.ts - API options
packages/typescript/src/api/options.ts - API protocol types
packages/typescript/src/api/proto.ts - API server
tsc/internal/api/server.go
Other components
- Developer
- VS Code user
- Project files
Connections 29
- Developer → CLI entrypoint: invokes
tsc/cmd/tsc/main.go - CLI entrypoint → Compiler program: compiles project
- Compiler program → Type checker: checks types
tsc/internal/compiler/program.go - Compiler program → AST scanner: parses source
- Compiler program → Project files: reads project
- CLI entrypoint → Incremental builds: supports incremental builds
- Incremental builds → Compiler program: wraps program
tsc/internal/execute/incremental/program.go - CLI entrypoint → Watch manager: supports watch mode
- Watch manager → Project files: watches changes
- Developer → Async API client: uses API
- Developer → Sync API client: uses API
- Async API client → API options: resolves executable
packages/typescript/src/api/async/client.ts - Async API client → Filesystem callbacks: encodes callbacks
packages/typescript/src/api/async/client.ts - Async API client → API protocol types: uses protocol types
packages/typescript/src/api/async/client.ts - Sync API client → API options: reads options
packages/typescript/src/api/sync/client.ts - Sync API client → Filesystem callbacks: configures callbacks
packages/typescript/src/api/sync/client.ts - Sync API client → API protocol types: uses protocol types
packages/typescript/src/api/sync/client.ts - CLI entrypoint → API server: starts API mode
tsc/cmd/tsc/main.go - VS Code user → Extension session: uses editor
- Extension session → Language client: starts client
packages/vscode-typescript/src/session.ts - Language client → SDK selection: selects executable
packages/vscode-typescript/src/client.ts - Language client → LSP server: connects to server
- LSP server → Language service: dispatches language requests
tsc/internal/lsp/server.go - Language service → Compiler program: uses compiler program
tsc/internal/ls/languageservice.go - Language service → Type checker: queries type information
tsc/internal/ls/languageservice.go - Extension session → Editor commands: registers commands
packages/vscode-typescript/src/session.ts - Extension session → LSP middleware: configures middleware
packages/vscode-typescript/src/session.ts - Extension session → Content mapping: configures mapping
packages/vscode-typescript/src/session.ts - Extension session → Telemetry reporting: configures reporting
packages/vscode-typescript/src/session.ts