microsoft/edit
60.9
Adequate · 14 November 2026
29.7k
lines of production code
Rust
primary language
5
measurements over time
What this system is
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
Build-time configuration for ICU libraries and i18n translations
The build script for the edit crate now automatically configures ICU library linking (including SONAMEs and renaming) and generates Rust source code for internationalization (i18n) translations at compile time. This allows the application to support multiple languages and adapt to different operating systems' ICU library conventions without manual setup.
crates/edit/build · 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
Integrated LSH-based syntax highlighting into the edit crate
The edit crate now includes a local LSH (Lightweight Syntax Highlighter) module that provides syntax highlighting capabilities. This integration introduces a Highlighter struct for parsing and highlighting document lines, a HighlighterCache to optimize performance by caching state checkpoints and avoiding redundant parsing, and file association logic to map file paths to specific language definitions. Users benefit from improved syntax highlighting performance and accuracy within the editor.
crates/edit/src/lsh · high confidence
Introduce Microsoft Edit, a new terminal-based text editor
This change adds the initial implementation of the Microsoft Edit binary, a new terminal-based text editor. The application provides a full user interface with a menu bar, status bar, and file picker, supporting features such as opening and saving files, search and replace, undo/redo, and language detection via file associations. It includes rudimentary settings.json support for custom file associations, localization for multiple languages (including Chinese region aliases), and handles command-line arguments and stdin input.
crates/edit/src/bin · 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
Introduces arena allocator with debug borrow tracking and file I/O utilities
The \crates/edit/src/arena\ module now provides a high-performance arena allocator that simplifies memory management for UI trees and temporary allocations. In debug builds, a new \debug.rs\ wrapper tracks arena borrows to prevent use-after-free errors when multiple \ScratchArena\ instances borrow the same underlying arena, ensuring that only the most recent borrow remains valid. The module also exposes \fs.rs\ utilities (\read\_to\_vec\, \read\_to\_string\) that read file contents directly into arena-allocated buffers, reducing heap allocations. These changes are gated by the \debug\_assertions\ configuration and the \single-threaded\ feature flag, which controls whether the scratch arena implementation uses thread-local storage or static single-threaded arenas.
crates/edit/src/arena · high confidence
New SIMD-accelerated text editing primitives
The \crates/edit/src/simd\ module now provides high-performance, architecture-specific implementations for core text editing operations. This includes \lines\_fwd\ and \lines\_bwd\ for rapidly seeking forward and backward through lines using AVX2 (x86\_64), NEON (aarch64), and LASX/LSX (LoongArch64). It also introduces \memchr2\ for finding two distinct characters simultaneously and \memset\ for filling slices with arbitrary-sized values (2, 4, or 8 bytes) using SWAR techniques, all of which replace or supplement slower fallback implementations to improve edit performance on supported hardware.
crates/edit/src/simd · high confidence
New Unicode measurement and control character sanitization modules
The \crates/edit/src/unicode\ module now includes \measurement.rs\ and \sanitize.rs\. The measurement module provides a \MeasurementConfig\ API for navigating documents using logical (grapheme-based) and visual (laid-out) cursor positions, supporting features like tab size and word-wrap configuration. The sanitize module adds \sanitize\_control\_chars\ to replace C0/C1 control characters and invalid UTF-8 sequences with their Unicode visual representations (e.g., ␀, ␁), ensuring safe display of raw text.
crates/edit/src/unicode · 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
New low-level editor infrastructure and utilities
The \crates/edit/src\ module has been significantly expanded with foundational components for the editor. This includes a custom allocator trait and implementation (\alloc.rs\), borrowed-memory collections like \BVec\ and \BString\ (\collections/\), and a clipboard abstraction (\clipboard.rs\). New parsing capabilities have been added, including a fast approximate float parser (\float.rs\), a JSONC parser for settings (\json.rs\), and base64 encoding (\base64.rs\). The module also introduces a framebuffer for terminal rendering (\framebuffer.rs\), a non-cryptographic hash function (\hash.rs\), and bindings to the ICU library for encoding conversion (\icu.rs\). These changes provide the underlying data structures and utilities required for the editor's core functionality.
crates/edit/src · 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
Platform-specific system abstraction restructured for Unix and Windows
The system abstraction layer in \crates/edit/src/sys\ has been reorganized to provide distinct, platform-specific implementations for Unix and Windows. This change introduces \unix.rs\ and \windows.rs\ modules that handle low-level operations such as virtual memory management (mmap/VirtualAlloc), terminal state configuration (termios/Console API), and input stream redirection. The \mod.rs\ file now acts as a dispatcher, conditionally including the appropriate platform module and exposing a unified \canonicalize\ function for non-Windows systems, ensuring the editor functions correctly across different operating systems.
crates/edit/src/sys · high confidence
Refactored grapheme table generator into a dedicated crate
The grapheme table generator tool has been moved from the \tools/grapheme-table-gen\ directory into its own \crates/unicode-gen\ crate. This change reorganizes the project structure by extracting the arena and helper logic into a separate module, making the generator a standalone component within the workspace. The tool itself continues to process Unicode Character Database (UCD) XML files to generate efficient, multi-stage trie lookup tables for grapheme cluster breaking, line breaking, and character width properties.
crates/unicode-gen · high confidence
Behavioural changes
Introduction of a new high-performance gap buffer implementation
The text editing engine in the edit crate has been replaced with a new gap buffer implementation located in \crates/edit/src/buffer\. This new buffer supports both small buffers (using standard heap allocation) and large buffers (using virtual memory for efficient resizing), and includes a dedicated navigation module for word-forward and word-backward movements that matches VS Code's behavior. The change also introduces a new undo/redo history system that tracks text changes and newline format modifications, allowing for more granular and correct undo operations.
crates/edit/src/buffer · high confidence
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 benchmark suite for edit crate components; 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 cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 58 → 61 (+2.8)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.
Lenses
- Code Health 56 → 80 (+24.0)
- Architecture 97 → 97 (+0.0)
- Maturity 64 → 66 (+2.3)
- Readiness 47 → 46 (-1.4)
- Security 85 → 79 (-6.0)
Resolved (14)
- Duplicated block (12 lines × 2) (crates/edit/src/icu.rs)
- Duplicated block (12 lines × 2) (crates/edit/src/simd/lines_fwd.rs)
- Duplicated block (13 lines × 2) (crates/unicode-gen/src/main.rs)
- Duplicated block (14 lines × 2) (crates/edit/src/framebuffer.rs)
- Duplicated block (15 lines × 2) (crates/edit/src/simd/lines_fwd.rs)
- Duplicated block (6 lines × 2) (crates/edit/src/bin/edit/draw_statusbar.rs)
- Duplicated block (9 lines × 2) (crates/edit/src/tui.rs)
- Duplicated block (9 lines × 2) (crates/lsh/src/compiler/generator.rs)
- Hotspot: crates/edit/src/bin/edit/main.rs (crates/edit/src/bin/edit/main.rs)
- Hotspot: crates/edit/src/tui.rs (crates/edit/src/tui.rs)
- Hotspot: crates/lsh/src/main.rs (crates/lsh/src/main.rs)
- No ADRs found
- Off-boarding risk: anonymized user #1
- TodoComment (crates/edit/src/icu.rs)
New (60)
- Duplicated block (12 lines × 2) (crates/edit/src/simd/lines_fwd.rs)
- Duplicated block (13 lines × 2) (crates/unicode-gen/src/main.rs)
- Duplicated block (15 lines × 2) (crates/edit/src/framebuffer.rs)
- Duplicated block (15 lines × 2) (crates/edit/src/simd/lines_fwd.rs)
- Duplicated block (5 lines × 2) (crates/edit/src/arena/release.rs)
- Duplicated block (6 lines × 2) (crates/edit/src/tui.rs)
- Duplicated block (7 lines × 2) (crates/edit/src/bin/edit/draw_statusbar.rs)
- Duplicated block (9 lines × 2) (crates/lsh/src/compiler/generator.rs)
- Edited copies of one member (4 members, 10+ corresponding lines) (crates/edit/src/simd/lines_bwd.rs)
- Edited copy of a member (12 corresponding lines) (crates/edit/src/collections/vec.rs)
- Edited copy of a member (12 corresponding lines) (crates/edit/src/tui.rs)
- Edited copy of a member (12 corresponding lines) (crates/lsh/src/compiler/frontend.rs)
- Edited copy of a member (13 corresponding lines) (crates/edit/src/buffer/gap_buffer.rs)
- Edited copy of a member (13 corresponding lines) (crates/edit/src/collections/vec.rs)
- Edited copy of a member (14 corresponding lines) (crates/edit/src/tui.rs)
- Edited copy of a member (15 corresponding lines) (crates/edit/src/bin/edit/documents.rs)
- Edited copy of a member (193 corresponding lines) (crates/unicode-gen/src/main.rs)
- Edited copy of a member (20 corresponding lines) (crates/edit/src/arena/release.rs)
- Edited copy of a member (23 corresponding lines) (crates/lsh/src/runtime.rs)
- Edited copy of a member (30 corresponding lines) (crates/edit/src/simd/memchr2.rs)
- …and 40 more
Changes since last survey
- 3 commits — 0 feature/other, 3 fixes
By area
- crates/edit — 2 commits
- crates/lsh — 1 commit
Notable commits
- fix: Fix \w not matching UTF-8 continuation bytes (#1001)
- fix: Fix compilation with stable Rust (#1002)
- fix: Fix several ICU usage bugs (#998)
Written by cca.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 14 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit b7f83220868373945945e2218e852c24cbb4dcf0 — the exact code this score is about.
- Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-e1a3b69fc8ee.