Skip to content
CAI
Software that uses CAICheck a score

microsoft/edit

59.2

Adequate · 28 September 2026

28.3k

lines of production code

Rust

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a high-performance, cross-platform terminal text editor named 'Edit', built in Rust. It features a custom lightweight syntax highlighting engine (LSH) that compiles language definitions into efficient bytecode for rapid rendering. The application provides a command-line interface with document management, search and replace, and internationalization support, packaged for Windows, Linux, and macOS.

How it got here

2025 — Microsoft governance and workspace restructuring

11 changes.

The project was rebranded as 'Edit' and restructured into a Rust workspace, removing legacy source modules and system abstractions in favor of a new architecture with a dedicated syntax highlighting library. This period focused on establishing Microsoft open-source governance, updating build tooling to Rust edition 2024, and migrating release pipelines to OneBranch with comprehensive installation assets for Windows, Linux, and macOS.

2026 — Lightweight Syntax Highlighter implementation

5 changes.

This period focused on the development of the Lightweight Syntax Highlighter (LSH), introducing a new crate with a compiler pipeline that translates DSL definitions into optimized bytecode. The work included creating initial language definitions for a wide range of formats, expanding test coverage across 15 languages, and adding fuzzing harnesses to ensure the stability of the new highlighting engine.

Features

Add man page for the edit command

A new man page (edit.1) has been added to the assets directory, documenting the 'edit' command. It covers the basic usage, the interactive mode-less editing features, and specific options such as --goto for opening files at precise line and character positions, along with standard help and version flags.

assets/manpage · high confidence

Initial release of the edit crate with core editing engine and CLI application

This change introduces the \edit\ crate, providing the foundational text editing engine and the \edit\ CLI application. The engine includes a high-performance arena allocator for memory management, a gap-buffer based text buffer, and a new LSH (Lightweight Syntax Highlighting) compiler and runtime for syntax highlighting. The CLI application features a terminal UI with document management, search and replace functionality, and support for internationalization (i18n) via ICU. It also includes benchmarks for the buffer, float parsing, glob matching, hashing, JSON parsing, and LSH compilation.

crates/edit · high confidence

Initial syntax highlighting definitions for LSH

This change introduces the initial set of syntax highlighting definitions for the LSH (Line-oriented Syntax Highlighting) system. It adds a comprehensive library of \.lsh\ files covering a wide range of programming languages and file formats, including C, C++, C\#, F\#, Go, Java, JavaScript, Lua, Odin, PowerShell, Python, Ruby, Rust, Shell, TOML, XML, YAML, JSON, Markdown, Diff, Git commit/rebase messages, and properties files. The entry also includes the LSH language's own definition and a README documenting the syntax and execution model for writing these definitions.

crates/lsh/definitions · high confidence

Introduce the LSH compiler for syntax highlighting

The \crates/lsh/src/compiler\ module now provides a complete compiler pipeline for the LSH (Lightweight Syntax Highlighting) language. It translates LSH source files into an intermediate representation (IR) via a frontend parser, optimizes the IR by removing no-ops and redundant offset operations, and generates bytecode through a backend that performs linear-scan register allocation. The compiler also includes a code generator capable of producing human-readable assembly with ANSI colorization or Rust source code for integration, enabling the runtime to execute efficient, compiled syntax highlighting rules.

crates/lsh/src/compiler · high confidence

Introduce the Lightweight Syntax Highlighter (LSH) runtime and CLI

Added a new standalone crate providing a bytecode-based syntax highlighting engine. This includes a CLI tool with subcommands to compile DSL definitions into Rust code or assembly, and to render syntax-highlighted text to the terminal. The runtime executes compiled bytecode to produce highlight spans, supporting language detection via glob patterns and mapping highlight kinds to ANSI color codes for terminal output.

crates/lsh/src · high confidence

New installation assets and scripts for Windows, Linux, and macOS

The assets directory now includes a complete set of installation and packaging files. For Windows, an Inno Setup installer script (edit.iss) and a PowerShell build script (build-windows-setup.ps1) are added, enabling the creation of installers that can optionally add the editor to the system PATH and create a hardlink for the 'edit' command. For Linux, a shell script (install.sh) is provided to build the application from source and install it to the user's local bin or system-wide, including logic to handle ICU library dependencies. A Snapcraft manifest (snapcraft.yaml) is also added for Snap package distribution. Additionally, a desktop entry file (com.microsoft.edit.desktop) is included for Linux desktop integration, and the application icon (edit.svg) is updated.

assets · high confidence

Removals

Removal of grapheme-table-gen tool

The \tools/grapheme-table-gen\ utility, previously used to generate grapheme cluster and line break tables from UCD data, has been removed from the codebase.

tools/grapheme-table-gen · high confidence

Architecture

Complete source code restructuring and module removal

The project has undergone a major structural reorganization in the \src\ directory. Several core modules have been completely removed, including \apperr.rs\ (custom error handling), \buffer.rs\ (text buffer implementation), \framebuffer.rs\ (rendering), \helpers.rs\ (geometry and utility types), \icu.rs\ (Unicode/ICU integration), \loc.rs\ (localization strings), \memchr.rs\ (SIMD search routines), \trust\_me\_bro.rs\ (unsafe lifetime helpers), \ucd.rs\ (Unicode character data), and \ucd\_gen.rs\ (generated Unicode tables). The \main.rs\ and \tui.rs\ modules have also been deleted, indicating a significant shift in the application's architecture and component layout.

src · high confidence

Behavioural changes

Migrated release pipeline to OneBranch with vPack and Inno Setup support

The release build process has been updated to use the OneBranch governed pipeline template, replacing the previous Azure DevOps setup. This change introduces support for creating vPacks (versioned packages) for Windows distributions, configurable via a new \createvpack\ parameter. The pipeline now builds for x86\_64 and aarch64 architectures, integrates Inno Setup for installer generation, and enforces code signing for distribution binaries. Additionally, a dedicated NuGet configuration file (\nuget.config\) has been added to route package sources through Microsoft's internal Azure Artifacts feeds, ensuring compliance with internal CI restrictions.

.pipelines · high confidence

Project restructured with official Microsoft documentation and build configuration

The repository has been reorganized to include standard Microsoft open-source governance files, specifically CODE\_OF\_CONDUCT.md, CONTRIBUTING.md, and SECURITY.md, which define reporting channels and community guidelines. The project identity has been updated from 'MS-DOS Editor Redux' to 'Edit' with a new icon and comprehensive README documentation covering installation via WinGet, Homebrew, and Linux scripts, as well as build instructions. Build tooling has been adjusted by deleting the manual build.rs script (replacing it with a rustfmt.toml adopting the rust-lang/rust style edition 2024) and updating .gitignore to exclude profiling artifacts.

(repo-wide) · high confidence

Removal of Windows batch build script

The Windows batch build script (tools/build\_release\_windows.bat) has been removed. This script previously configured Rust compiler flags to statically link the C runtime and disable backtrace code to reduce binary size, and now the build process no longer includes these specific optimizations or the manual build command.

tools · high confidence

Removal of legacy Unix and Windows system abstraction modules

The platform-specific system implementation files \src/sys/unix.rs\ and \src/sys/windows.rs\ have been deleted. This removes the legacy code responsible for low-level terminal initialization, raw mode handling, window size injection, and language preference detection on Unix and Windows platforms, indicating a structural reorganization of the system layer.

src/sys · high confidence

Test coverage

Added fuzzing harness for the LSH highlighter; Expanded syntax highlighting test coverage for 15 languages and formats.

Dependencies

Project restructured into a Rust workspace with new crates and updated dependencies

The project has been restructured from a single crate into a Rust workspace containing the main \edit\ editor, the \lsh\ (Lightweight Syntax Highlighter) library, and a \unicode-gen\ tool. The \edit\ crate now depends on \lsh\ for syntax highlighting and uses \toml-span\ (v0.7) instead of the default \toml\ crate to improve build times. Windows support has been updated to use the \winresource\ crate (replacing \winres\) and \windows-sys\ v0.61. A new fuzzing harness (\edit-fuzz\) has been added using \libfuzzer-sys\, and the \grapheme-table-gen\ tool has been removed. The workspace enforces Rust edition 2024 and resolver v3, with release profiles optimized for binary size using \opt-level = "s"\ and stripping.

(dependencies) · high confidence

Housekeeping

Added documentation for editing traces directory

A README file has been added to the assets/editing-traces directory to explain that it contains ASCII-only editing traces from Seph Gentle's rustcode project, provided under the CC BY 4.0 license.

assets/editing-traces · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 67 → 59 (-7.4)
  • Rubric changed (rubric-2026.09.8 → rubric-2026.09.16) — scores are not directly comparable.

Lenses

  • Code Health 75 → 66 (-9.2)
  • Architecture 100 → 95 (-4.9)
  • Maturity 62 → 63 (+0.2)
  • Readiness 60 → 46 (-14.0)
  • Security 78 → 85 (+6.2)
  • Performance 100 (new)

Resolved (31)

  • Compiler::as_mermaid (cognitive 38) (crates/lsh/src/compiler/mod.rs)
  • Compiler::as_mermaid (cyclomatic 29) (crates/lsh/src/compiler/mod.rs)
  • Duplicated block (10 lines × 2) (crates/stdext/src/collections/vec.rs)
  • Duplicated block (10 lines × 2) (crates/stdext/src/simd/memset.rs)
  • Duplicated block (12 lines × 2) (crates/stdext/src/collections/vec.rs)
  • Duplicated block (14 lines × 2) (crates/edit/src/helpers.rs)
  • Duplicated block (18 lines × 2) (crates/stdext/src/simd/memset.rs)
  • Duplicated block (18 lines × 2) (crates/stdext/src/simd/memset.rs)
  • Duplicated block (5 lines × 2) (crates/stdext/src/simd/memset.rs)
  • Duplicated block (7 lines × 2) (crates/lsh/src/compiler/backend.rs)
  • Hotspot: crates/edit/src/input.rs (crates/edit/src/input.rs)
  • Hotspot: crates/lsh-bin/src/main.rs (crates/lsh-bin/src/main.rs)
  • LivenessAnalysis::compute_use_def (cognitive 21) (crates/lsh/src/compiler/backend.rs)
  • LivenessAnalysis::compute_use_def (cyclomatic 19) (crates/lsh/src/compiler/backend.rs)
  • LivenessAnalysis::dfs (cognitive 22) (crates/lsh/src/compiler/backend.rs)
  • LivenessAnalysis::dfs (cyclomatic 19) (crates/lsh/src/compiler/backend.rs)
  • Members sharing a duplicated core (4 members, 50+ identical tokens) (crates/edit/src/simd/lines_bwd.rs)
  • Members sharing a duplicated core (4 members, 50+ identical tokens) (crates/edit/src/simd/lines_fwd.rs)
  • Off-boarding risk: anonymized user #1
  • TodoComment (crates/edit/src/buffer/gap_buffer.rs)
  • …and 11 more

New (38)

  • Consistent naming in BVec, but inconsistent with BString (see above). BVec uses 'alloc' for both, while BString uses 'alloc' for one and 'arena' for the other.
  • Duplicate constructors with ambiguous distinction. Two methods exist to construct the same type with identical parameters, but the API surface does not clarify the difference between 'new' and 'new_rc' (likely referring to reference counting or allocation strategy).
  • Duplicated block (10 lines × 2) (crates/edit/src/collections/vec.rs)
  • Duplicated block (10 lines × 2) (crates/edit/src/simd/memset.rs)
  • Duplicated block (12 lines × 2) (crates/edit/src/collections/vec.rs)
  • Duplicated block (18 lines × 2) (crates/edit/src/simd/memset.rs)
  • Duplicated block (18 lines × 2) (crates/edit/src/simd/memset.rs)
  • Duplicated block (5 lines × 2) (crates/edit/src/simd/memset.rs)
  • Hotspot: crates/lsh/src/compiler/generator.rs (crates/lsh/src/compiler/generator.rs)
  • Hotspot: crates/lsh/src/main.rs (crates/lsh/src/main.rs)
  • Inconsistent naming for selection manipulation. The API uses 'selection_update_*' for setting/modifying selection state, but 'selection_range' for retrieving it. Furthermore, 'selection_range' returns a PathBuf (file path?) which seems semantically mismatched for a text selection range (which should be a Range<usize> or similar). If it returns a file path, it is not a selection range. If it returns a text range, the return type is wrong. Assuming it returns a text range, the naming 'selection_range' is inconsistent with the 'selection_update' verb-noun pattern.
  • Inconsistent operation naming. 'find_and_select' performs a search and moves the cursor/selection, while 'find_and_replace' performs a search and modifies content. The naming suggests 'find_and_select' is a search operation, but it has side effects on cursor state. 'find_and_replace' and 'find_and_replace_all' are consistent, but the distinction between 'select' (cursor movement) and 'replace' (content mutation) is buried in the verb. A more consistent pattern might be 'search_and_select' vs 'search_and_replace'.
  • Inconsistent parameter naming for allocator. 'reserve' takes 'alloc' while 'reserve_exact' takes 'arena'. These are semantically the same parameter (an allocator instance), but the naming differs, suggesting a potential confusion between 'alloc' (generic allocator) and 'arena' (specific allocator type).
  • Job token omits the contents scope its checkout needs
  • Members sharing a duplicated core (4 members, 50+ identical tokens) (crates/edit/src/simd/lines_bwd.rs)
  • Members sharing a duplicated core (4 members, 50+ identical tokens) (crates/edit/src/simd/lines_fwd.rs)
  • MethodTooLong: Backend.generate_code (crates/lsh/src/compiler/backend.rs)
  • Off the main sequence: lsh
  • Off-boarding risk: anonymized user #1
  • Outdated: anyhow
  • …and 18 more

Changes since last survey

  • 8 commits — 6 feature/other, 2 fixes

By area

  • crates/edit — 5 commits
  • .github/codeql — 1 commit
  • .github/workflows — 1 commit
  • crates/lsh — 1 commit

Notable commits

  • fix: Fix reading overly large files (#954)
  • fix: Theoretical fix for crashing when tabbing (#955)
  • change: Configure CodeQL (#956)
  • change: Don't indent a line the selection stops at column 0 of (#918)
  • change: Enable CodeQL for actions (#959)
  • change: Reintegrate stdext into edit (#960)
  • change: Turn lsh into a standalone crate (#958)
  • change: Unindent leading whitespace on backspace (#792)

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

microsoft/edit was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 28 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit c470ca59af44c176ea39c672d09b32061c274896 — the exact code this score is about.
  • Scored under rubric-2026.09.16 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-d46da229e3fd.