Skip to main content

Overview

The Editor Layer (src/vs/editor/) implements VS Code’s powerful text editor, known as Monaco Editor. This layer handles text rendering, editing operations, language features, and provides the foundation for the code editing experience.

Architecture

The editor is split into several key areas:

Editor Model

The editor separates model (text content) from view (rendering):
Located in: src/vs/editor/common/model.ts

Core Structures

Located in: src/vs/editor/common/core/position.ts

Editor View

Located in: src/vs/editor/browser/editorBrowser.ts

Editor Decorations

Decorations add visual elements to the editor:

Editor Features

The contrib/ directory contains 60+ editor features:
Located in: src/vs/editor/contrib/find/
Located in: src/vs/editor/contrib/suggest/
Located in: src/vs/editor/contrib/hover/

Language Features

Editor Configuration

View Zones and Widgets

Diff Editor

Key Takeaways

  • The editor separates model (content) from view (rendering)
  • Core structures: Position, Range, Selection represent locations in text
  • Decorations add visual elements without modifying the model
  • 60+ contrib features provide rich editing capabilities
  • Language features are registered via provider APIs
  • The editor is highly configurable through IEditorOptions

Next Steps

Workbench Layer

Explore the application workbench structure

Platform Layer

Review platform services