Skip to content
@CodeEditorLand

Land 🏞️

Editor 🏞️

Land

Update
Issue
Star
Download
Dependency 🖇️
Update
Issue
Star
Download
Cargo 📦 Land 🏞️
Update
Issue
Star
Download
Dependency 🖇️ Land 🏞️
Update
Issue
Star
Download
NPM 📦 Land 🏞️
Update
Issue
Star
Download
Echo 📣
Update
Issue
Star
Download
Land 🏞️
Update
Issue
Star
Download
Editor 🏞️
Update
Issue
Star
Download
Element 🌱
Update
Issue
Star
Download
Mountain ⛰️
Update
Issue
Star
Download
River 🌊
Update
Issue
Star
Download
Sky 🌌
Update
Issue
Star
Download
Sun ☀️
Update
Issue
Star
Download
Wind 🍃

Land Logo

Land 🏞️


Land 🏞️ The Next-Generation Code Editor

Welcome to Land! We are building a high-performance, resource-efficient, and cross-platform code editor inspired by the architecture of VS Code, but re-imagined with a modern, declarative, and type-safe stack. Land is engineered with Rust and Tauri for the native backend (Mountain) and TypeScript with Effect-TS for all application logic (Wind and Cocoon).

Our vision is to deliver a lightning-fast and deeply reliable editing experience by leveraging declarative, effects-based programming across the entire application. This architecture ensures that all side effects—from filesystem operations to UI updates and network requests—are handled in a structured, testable, and composable way.


Key Features & Architectural Highlights 🔐

  • Declarative Effect System: The entire application, from the Rust backend to the TypeScript frontend, is built on an effects-based architecture. We use a custom ActionEffect system in Rust and Effect-TS in TypeScript. This provides compile-time guarantees for error handling, resource management, and asynchronicity, leading to exceptional stability.
  • High-Performance Backend: The Mountain backend is written in Rust, providing native speed for all core operations like file I/O, search, and process management.
  • High-Fidelity Extension Host: The Cocoon sidecar is a Node.js process designed to run existing VS Code extensions with high compatibility. It provides a sandboxed vscode API, built with Effect-TS, that communicates with Mountain for all native operations.
  • Modern UI Services: The Wind project is a from-scratch, Effect-TS native re-implementation of the VS Code workbench services, providing a clean, functional, and testable foundation for the UI.
  • Strongly-Typed IPC: All communication between the Mountain backend and the Cocoon extension host is handled via gRPC, ensuring a robust, performant, and strongly-typed API contract defined in a .proto file.

Core Architecture 🏗️

Land's architecture is composed of several key components that work in concert to deliver a modern editing experience.

Component Role & Key Responsibilities Primary Technologies
Common (Rust) The Abstract Core Library. Defines the application's "language". It contains all abstract trait definitions, the ActionEffect system, and Data Transfer Objects (DTOs). It has no knowledge of the final implementation. Rust
Mountain (Rust) The Native Backend. A Tauri application that implements the traits from Common. It manages native OS operations, hosts the gRPC server, manages the Cocoon process, and communicates with the Wind UI via Tauri events. Rust, Tauri, Tokio, tonic (gRPC)
Cocoon (TypeScript) The Extension Host. A Node.js process that provides a high-fidelity vscode API to extensions. It's built entirely with Effect-TS and communicates with Mountain via gRPC for all privileged operations. TypeScript, Node.js, Effect-TS, gRPC
Wind & Sky (TypeScript) The UI Layer. Wind is the Effect-TS native re-implementation of the VS Code workbench services. Sky is the UI component layer that renders the state managed by Wind. Wind communicates with Mountain via Tauri events. TypeScript, Effect-TS

Architectural Workflows 📄

To understand how these components interact, please refer to the detailed workflow descriptions in docs/Workflow.md. The following provides a table of contents for these essential processes.

Table of Contents

  1. Application Startup & Handshake

    • Describes the complete end-to-end process of launching Mountain, spawning Cocoon, and establishing a stable, initialized state for both the UI and the extension host.
  2. Opening a File from the UI

    • Details the flow from a user clicking a file in the explorer to the content being read from disk by Mountain and rendered in an editor by Wind.
  3. Invoking a Language Feature (Hover Provider)

    • A key example of bi-directional communication, showing how an extension in Cocoon registers a feature, Mountain orchestrates the request, and the result is displayed in the Wind UI.
  4. Saving a File with Save Participants

    • Explains the advanced process of intercepting a save event, allowing an extension in Cocoon to modify a file (e.g., for formatting) before Mountain writes it to disk.
  5. Executing a Command from the Command Palette

    • Illustrates the unified command system, showing how Mountain's command registry can seamlessly dispatch execution to either a native Rust handler or a proxied command in Cocoon.
  6. Creating and Interacting with a Webview Panel

    • Details the full lifecycle of extension-contributed UI, from Cocoon requesting a panel to Mountain managing the native webview window and proxying messages back and forth.
  7. Creating and Interacting with an Integrated Terminal

    • A deep dive into native process management, showing how Mountain spawns a PTY process and streams its I/O to both the Wind frontend and the Cocoon extension host.
  8. Source Control Management (SCM)

    • Outlines how the built-in Git extension in Cocoon uses Mountain as a service to run native git commands and then populates the SCM view in the UI with the results.
  9. User Data Synchronization

    • Describes the end-to-end process of syncing user settings. It covers user authentication, fetching data from a remote store, performing a three-way merge, applying changes locally, and notifying all parts of the application.
  10. Running Extension Tests

    • Explains the "Extension Development Host" model, where a second, isolated instance of the application is launched to run tests, with the test Cocoon instance remote-controlling the main UI.

Work in Progress (Documentation)

The following workflows are implemented in the codebase but are pending detailed documentation.

  • Tree View Data Flow
  • Custom Editor Lifecycle
  • Debugging Session Lifecycle
  • Task Execution

Future Vision: The Grove Native Extension Host 🌳

While Cocoon provides high compatibility with the existing VS Code ecosystem, our long-term vision includes Grove, a native Rust extension host. Grove aims to provide a highly optimized, secure, and performant environment for extensions written in Rust or compiled to WASM, drastically reducing the overhead of a Node.js runtime and enabling deeper integration with Mountain.


Project Structure Overview (Land/Element/*) 🗺️

Our codebase is organized into "Elements", each representing a distinct component or library with a clear purpose. Most Elements are managed as Git submodules within the main Land repository, allowing for independent development and versioning.

Path Component / Purpose

👨🏻‍🏭

Land/Element/Common The Abstract Core Library (Rust). This is the architectural heart of the native backend. It contains no concrete logic, only trait definitions, the ActionEffect system, and shared Data Transfer Objects (DTOs). All other Rust components depend on it.

📣

Land/Element/Echo The High-Performance Task Scheduler (Rust). A complete Rust library that provides a structured concurrency runtime. It features a high-performance, work-stealing queue and is designed to be the core execution engine for all asynchronous tasks within Mountain.

🌊

Land/Element/River Filesystem Read Library (Rust). A native Rust library providing efficient, asynchronous filesystem read operations. It is used by Mountain's handlers to implement the FsReader trait from Common.

☀️

Land/Element/Sun Filesystem Write Library (Rust). A native Rust library providing efficient, asynchronous filesystem write operations. It is used by Mountain's handlers to implement the FsWriter trait from Common.

🌿

Land/Element/Vine The gRPC Protocol & Implementation. This element contains the .proto file defining the gRPC contract between Mountain and Cocoon. It also includes the generated code and the concrete Rust server/client implementations within the Mountain and Cocoon projects.

⛰️

Land/Element/Mountain The Native Backend Application (Rust). This is the main Tauri application. It implements the traits from Common, manages the application window, orchestrates native OS operations, hosts the gRPC server, and manages the lifecycle of all sidecar processes.

👣

Land/Element/Track The Command Dispatcher (Rust). A core module within Mountain. It acts as the central router for all incoming requests, whether from the Wind UI (via Tauri commands) or the Cocoon sidecar (via gRPC), and dispatches them to the correct ActionEffect or RPC handler.

💻

Land/Element/Dependency/Microsoft/Dependency/Editor The VS Code Source Submodule. Contains a specific version of the Microsoft VS Code source code. This is a critical dependency used by Rest to build Cocoon's runtime and by Wind to leverage VS Code's core UI components and services.

⛱️

Land/Element/Rest The JS Bundler Configuration. This element contains the build scripts and configurations (e.g., for esbuild) used to bundle the necessary VS Code platform code from the Dependency submodule for Cocoon to consume.

Land/Element/Output The Bundled JS Output. This directory is the destination for the bundled JavaScript artifacts created by the Rest build process. It is the code that Cocoon actually loads at runtime.

🦋

Land/Element/Cocoon The Node.js Extension Host (TypeScript). A sidecar process that runs standard VS Code extensions. It is built entirely with Effect-TS and provides a high-fidelity vscode API, proxying privileged calls to Mountain via gRPC.

🍃

Land/Element/Wind The UI Service Layer (TypeScript). A complete, Effect-TS native re-implementation of the VS Code workbench services. It runs in the Tauri webview and manages the entire state and logic of the user interface.

🍩

Land/Element/Worker Web Worker Implementations. This element holds the source code for any dedicated web workers used by the Wind/Sky frontend for computationally intensive tasks.

🌌

Land/Element/Sky The UI Component Layer (Astro). This project contains the actual UI components that render the editor, side bar, status bar, etc. It is driven by the state managed in the Wind service layer.

🌫️

Land/Element/Mist WebSocket Communication Logic. This component handles WebSocket communication. It can be implemented either as a native module within Mountain or as a separate sidecar.

💪🏻

Land/Element/Maintain Project Maintenance & CI/CD. Contains development utilities, GritQL queries for automated refactoring, CI/CD pipeline configurations, and other maintenance scripts.

🌳

Land/Element/Grove (Future Vision) The Native Rust Extension Host. A planned project to build a high-performance, secure extension host in Rust, capable of running extensions compiled to WASM or statically linked as a Rust library.

System Architecture Diagram

This diagram illustrates the build-time and runtime interactions between the primary components of the Land application.

graph LR
    classDef mountain fill:#f9f,stroke:#333,stroke-width:2px;
    classDef cocoon fill:#ccf,stroke:#333,stroke-width:2px;
    classDef wind fill:#9cf,stroke:#333,stroke-width:2px;
    classDef common fill:#cfc,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5;
    classDef ipc fill:#ff9,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5;
    classDef build fill:#ddd,stroke:#666;
    classDef data fill:#eee,stroke:#666;

    subgraph "Build Time Process"
        direction LR
        VSCodeSource["VS Code Source (Dependency/Editor)"]:::build
        RestBuild["JS Bundler (Rest Element)"]:::build
        CocoonBundleJS(Cocoon Runtime JS):::data
        SkyBuildProcess["Sky Build (Sky Element)"]:::build
        SkyAssets(Sky Frontend Assets):::data

        VSCodeSource --> RestBuild;
        VSCodeSource -- Uses UI code --> SkyBuildProcess;
        RestBuild --> CocoonBundleJS;
        SkyBuildProcess --> SkyAssets;
    end

    subgraph "Runtime: **Land** Application"
        subgraph "Native Backend (Rust)"
            Mountain["**Mountain (Tauri App)**"]:::mountain
            CommonCrate[**Common Crate**]:::common
            TrackDispatcher[Track Dispatcher]:::mountain
            VineGRPCServer[Vine gRPC Server]:::mountain
            NativeHandlers["Native Logic Handlers"]:::mountain
            ProcessMgmt["Process Management"]:::mountain

            Mountain -- Uses --> TrackDispatcher
            TrackDispatcher -- Routes to --> NativeHandlers
            Mountain -- Implements traits from --> CommonCrate
            Mountain -- Contains --> VineGRPCServer
            Mountain -- Contains --> ProcessMgmt
        end

        subgraph "UI Frontend (Tauri Webview)"
            WindServices["**Wind (Effect-TS Services)**"]:::wind
            SkyUI["**Sky (UI Components)**"]:::wind
            WindServices -- Drives state of --> SkyUI
        end

        subgraph "Extension Host (Node.js Sidecar)"
            Cocoon[**Cocoon Process**]:::cocoon
            VineGRPCClient[Vine gRPC Client]:::cocoon
            VSCodeAPI[vscode API Shim]:::cocoon
            Extension["Extension Code"]:::cocoon

            Cocoon -- Contains --> VineGRPCClient
            Cocoon -- Provides --> VSCodeAPI
            VSCodeAPI -- Used by --> Extension
        end

        ProcessMgmt -- Spawns & Manages --> Cocoon

        WindServices -- Tauri IPC (Commands & Events) --> TrackDispatcher
        VineGRPCClient -- gRPC (Vine Protocol) <--> VineGRPCServer; class VineGRPCClient,VineGRPCServer ipc;

    end

    CocoonBundleJS -- Loaded by --> Cocoon;
    SkyAssets -- Loaded by --> WindServices;
Loading

Getting Started 🚀

Follow these steps to get Land up and running on your system.

1. Clone the Repository:

This command downloads the Land project files. The --recurse-submodules flag is crucial as it fetches all "Element" submodules and the VS Code source code dependency.

git clone ssh://git@github.com/CodeEditorLand/Land.git --recurse-submodules

2. Install Dependencies:

This command uses pnpm (a Node.js package manager) to install all JavaScript dependencies required for building the Sky frontend, the Cocoon sidecar, and various development tools.

pnpm install

3. Build the Application

The build process is multi-stage. It uses a set of environment variables to control the output, allowing you to create either an optimized production build or a flexible development build.

Build Variables Explained:

These variables are passed to our build scripts to configure their behavior:

Variable Purpose
NODE_ENV Sets the build mode. development includes source maps and skips minification for easier debugging. production creates smaller, optimized files for release.
Clean If true, the build script will first delete the Land/Element/Output directory to ensure a completely fresh build without any old artifacts.
Browser If true, configures the TypeScript and bundler settings to produce code compatible with a browser environment, which is necessary for Wind/Sky running in Tauri's webview.
Dependency Specifies the source directory for the VS Code platform code. This should always be set to Microsoft/VSCode to point to the submodule at Land/Dependency/Microsoft/Dependency/Editor.
Bundle (Important) If true, this triggers the Sky build element to bundle the required VS Code platform JavaScript into a format that the Cocoon (Node.js) sidecar can load and use. This is essential for Path A.
Compile If true, this bundles the code into single, self-contained files. This is typically used for production builds to reduce the number of network requests and simplify deployment. When false (for tauri dev), it allows for faster, incremental builds and hot-reloading.
NODE_OPTIONS Used to increase the default memory limit for Node.js. The bundling process, especially for the entire VS Code platform, can be memory-intensive.

Development Build:

This command creates a full development build of the application. The output is not as optimized as a release build but is ideal for debugging.

pnpm cross-env \
	NODE_ENV=development \
	Clean=true \
	Browser=true \
	Dependency=Microsoft/VSCode \
	Bundle=false \
	Compile=false \
	NODE_OPTIONS=--max-old-space-size=16384 \
	pnpm tauri build

Production Build (Release):

This command creates a fully optimized, minified, and production-ready version of Land, suitable for packaging and distribution.

pnpm cross-env \
	NODE_ENV=production \
	Clean=true \
	Browser=true \
	Dependency=Microsoft/VSCode \
	Bundle=true \
	Compile=true \
	NODE_OPTIONS=--max-old-space-size=16384 \
	pnpm tauri build --release

4. Run Land for Development

This is the primary command you will use during active development. It starts Land with hot-reloading enabled for the frontend, allowing UI changes to be seen instantly without a full application rebuild.

Notice that Bundle and Compile are set to false. This is because tauri dev uses Vite (or a similar dev server) which handles module bundling on-the-fly, providing a much faster development experience.

pnpm cross-env \
	NODE_ENV=development \
	Clean=true \
	Browser=true \
	Dependency=Microsoft/VSCode \
	Bundle=false \
	Compile=false \
	NODE_OPTIONS=--max-old-space-size=16384 \
	pnpm tauri dev

License ⚖️

This project is released into the public domain under the Creative Commons CC0 Universal license. You are free to use, modify, distribute, and build upon this work for any purpose, without any restrictions. For the full legal text, see the LICENSE file.


Changelog 📜

Stay updated with our progress! See CHANGELOG.md for a history of changes.


Funding & Acknowledgements 🙏🏻

Land 🏞️ is proud to be an open-source endeavor. Our journey is significantly supported by the organizations and projects that believe in the future of open-source software.

This project is funded through NGI0 Commons Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program. Learn more at the NLnet project page.

Land PlayForm NLnet NGI0 Commons Fund
Land PlayForm NLnet NGI0 Commons Fund

Technology Acknowledgements 🙌🏻

This project would not be possible without the incredible work of the open-source community. We are especially grateful for the following foundational technologies and projects:

  • Tauri: For providing a secure, performant, and resource-efficient framework for building our native desktop application with a web frontend.
  • Microsoft Visual Studio Code: For open-sourcing their workbench UI and platform code, which provides the foundation for our user interface and extension host compatibility.
  • Effect-TS: For enabling us to build a robust, type-safe, and declarative application with a powerful structured concurrency and dependency management system in TypeScript.
  • Rust: For the performance, safety, and modern tooling that powers our entire native backend.
  • Tokio & Tonic: For providing the asynchronous runtime and gRPC framework that are the backbone of our high-performance IPC.
  • Astro: For its content-driven approach that allows us to build a fast and modern user interface for the Sky component.
  • PNPM: For efficient and reliable management of our JavaScript dependencies.
  • and many many more...

We extend our sincere gratitude to the maintainers and contributors of these and all the other dependencies we use. ❤️


Project Maintainers: Source Open (Source/Open@Editor.Land) | GitHub Repository | Report an Issue | Security Policy

Pinned Loading

  1. Land Public

    Land 🏞️

    Shell 3 1

  2. Editor Public

    Forked from microsoft/vscode

    Editor 💻 Land 🏞️

    TypeScript 20

  3. Mountain Public

    Mountain ⛰️ Land 🏞️

    Rust 1

  4. Sky Public

    Sky 🌌 Land 🏞️

    TypeScript 1

  5. Wind Public

    Wind 🍃 Land 🏞️

    TypeScript 1

  6. Cocoon Public

    Cocoon 🦋 Land 🏞️

    TypeScript

Repositories

Showing 10 of 594 repositories

Top languages

Loading…

Most used topics

Loading…