/editors-ide-extension-development:editor-internals-buffers-rendering-and-performancefrom editors-ide-extension-development
Explains text buffer data structures (gap buffers, piece tables, ropes), rendering and viewport virtualization, indexing, code intelligence, JetBrains platform differences, terminal UI programming, and editor performance (startup, large files, input latency).
Ships in editors-ide-extension-development. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Part 4 of 5 of the Editors, IDEs and Extension Development reference (plugin
editors-ide-extension-development), covering §18–§23. Sibling skills:editor-choosing-vim-neovim-and-emacs(§0–§5),editor-vscode-architecture-and-the-protocol-layer(§6–§11),editor-vscode-extension-development(§12–§17),editor-reference(§24–§30). Section numbers are shared across the set; a reference written as §N →skillpoints into that sibling skill.Currency: Modal editing, buffer data structures and the protocols are stable. Two areas moved. See §24 →
editor-referencefor the AI and agent layer in editors, and the editor landscape itself.
⚠️ The organizing insight, and it reframes the whole "editor wars" conversation: ⚠️ the important layer stopped being the editor and became the PROTOCOLS. In the 2010s each editor reimplemented completion, go-to-definition and highlighting for every language — an editors × languages problem. ⚠️ LSP and Tree-sitter collapsed that into editors + languages, which is why new editors can be competitive within a year and why "which editor" matters far less than it used to (§9 →
editor-vscode-architecture-and-the-protocol-layer).Complements a programming-languages reference (parsing and compilers), a GitHub/Jira reference (the surrounding workflow), and a frontend reference (webview UI).
⚠️ GOTCHA boxes mark things that waste days — extension activation, buffer assumptions, and the performance traps.
The three ideas that organize this document:
- ⚠️ Editor choice is mostly preference; the protocol support is the substance (§9–§11 →
editor-vscode-architecture-and-the-protocol-layer). Ask what LSP and Tree-sitter integration looks like, not what the theme looks like.- ⚠️ Modal editing is a language, not a set of shortcuts (§3 →
editor-choosing-vim-neovim-and-emacs). Operators compose with motions and text objects — learning that grammar is the whole payoff, and memorizing keybindings is the failure mode.- ⚠️ Everything in an editor is a latency budget (§18–§20). Text buffers, rendering and parsing are all solved problems whose solutions exist because naive approaches feel slow at scale.
⚠️ The classic interview question that is also a real engineering decision. A naive string is O(n) per edit and unusable at scale.
⚠️ GAP BUFFER a gap at the cursor; insertion at the gap is O(1),
moving the gap is O(distance). ⚠️ Excellent for typing (edits cluster),
poor for scattered edits. Emacs uses this
⚠️ PIECE TABLE original buffer + append-only add buffer + a list of
PIECES describing the current document as spans of each.
⚠️ Edits never mutate existing text — which gives cheap undo and
natural change tracking. ⚠️ VS Code uses a piece table variant
⚠️ ROPE balanced tree of string chunks. O(log n) insert, delete,
index. ⚠️ Excellent for very large files and concurrent editing.
Used by Zed (and its ancestors), xi, and several Rust editors
LINE ARRAY simple, and O(n) for line insertion in the middle
⚠️ GOTCHA — the operations that decide the structure are not the ones people optimize. ⚠️ You need fast line-number ↔ offset conversion (for every LSP message, every diagnostic, every jump), fast slicing for rendering the visible region, and cheap snapshots for background work. ⚠️ A structure with fast insert but O(n) line lookup will feel slow in ways profiling attributes to the wrong place.
⚠️ Encoding is a persistent trap: ⚠️ UTF-8 storage, UTF-16 offsets in LSP (§9 → editor-vscode-architecture-and-the-protocol-layer),
grapheme clusters for cursor movement, and code points for regex — four different
notions of "position," and mixing them produces bugs that only appear with emoji, CJK
text or combining characters.
⚠️ Virtualization is mandatory: ⚠️ render only the visible lines plus a small
overscan. A 100k-line file must not create 100k DOM nodes or draw calls.
⚠️ The hard parts: variable-width glyphs and font metrics, ligatures, bidirectional
text, tabs vs spaces alignment, soft wrapping (⚠️ which breaks the clean line-number ↔
visual-row mapping and complicates everything downstream), and cursor/selection geometry.
⚠️ DOM vs GPU: ⚠️ VS Code renders in the DOM (with a canvas-based minimap); Zed
renders on the GPU with a custom framework, which is where its frame-rate claims come
from (§24.2 → editor-reference). ⚠️ The tradeoff is accessibility and platform text-input integration —
DOM gets screen readers, IME and selection semantics largely for free, and a custom GPU
renderer must reimplement all of it.
⚠️ Input latency is the metric users actually feel — not throughput — and the
budget is roughly a frame.
⚠️ How an IDE answers "find all references" across a million lines instantly.
⚠️ SYMBOL INDEX built on open/change, persisted across sessions
⚠️ INCREMENTAL recompute only what a change invalidates — this is the
whole ballgame. ⚠️ Salsa-style demand-driven computation with memoized
queries and dependency tracking is the modern approach (rust-analyzer)
⚠️ LAZY / ON-DEMAND don't fully analyze what nobody has asked about
FUZZY MATCHING ⚠️ the scoring function is what makes a file-picker
feel good or bad; consecutive-match and word-boundary bonuses matter
⚠️ The JetBrains difference (§21): ⚠️ it builds and persists its own full semantic model rather than delegating to a language server, which is why its refactorings and cross-language analysis go deeper — and why indexing a large project takes visible time and memory. That's the tradeoff, stated plainly.
⚠️ Plugin development targets the IntelliJ Platform, shared across IDEA, PyCharm,
WebStorm, GoLand, Rider and the rest.
Core concepts: PSI (Program Structure Interface — ⚠️ the semantic tree, richer than a
syntax tree), VFS (virtual file system), actions, inspections (⚠️ with quick-fixes),
intentions, run configurations, and extension points declared in plugin.xml.
⚠️ Built with Gradle via the IntelliJ Platform Gradle Plugin; distributed through the
JetBrains Marketplace.
⚠️ Honest comparison: ⚠️ the IntelliJ Platform is substantially more complex to learn
than the VS Code API and gives you access to a far richer semantic model. If your
plugin needs deep type-aware analysis or refactoring, that's the tradeoff you're buying.
⚠️ If you're building a terminal editor or TUI:
ANSI escape sequences, alternate screen buffer, raw mode, terminal capabilities
(terminfo), and ⚠️ the resize signal (SIGWINCH).
Libraries: ncurses, crossterm/ratatui (Rust), bubbletea (Go), blessed/ink
(Node), prompt_toolkit/textual (Python).
⚠️ The perennial gotchas: ⚠️ terminals vary enormously in capability; true-colour
support is inconsistent; wide (CJK) and zero-width characters break naive column
arithmetic; and mouse support requires explicit mode-setting and is inconsistently
implemented.
⚠️ STARTUP lazy-load everything; measure with extension profiling
⚠️ INPUT LATENCY the metric users feel. Budget ~one frame
⚠️ LARGE FILES virtualize (§19); many editors degrade or disable
features past a size threshold — that's a deliberate choice, not a bug
⚠️ EXTENSION COST one badly-activated extension taxes every startup (§13)
⚠️ FILE WATCHERS ⚠️ watching node_modules is the classic resource fire.
Configure files.watcherExclude and search.exclude
⚠️ LANGUAGE SERVERS usually the biggest memory consumer in a VS Code session
⚠️ Diagnosing: "Developer: Show Running Extensions" and the startup performance view;
--disable-extensions to bisect; ⚠️ and process-level inspection, because the extension
host and each language server are separate processes and the memory attribution is not
where people look.
What SKILL.md sets; muted values are Claude Code's defaults
5 skills in this plugin
/editor-choosing-vim-neovim-and-emacsUse when learning or configuring a terminal editor, or when someone asks which editor to use: choosing honestly rather than by tribe, nano and the cases it fits, vim's actual model of operators, motions, text objects and counts as a composable grammar, configuring vim and Neovim including Lua configuration and plugin managers, and what Emacs is and why its users stay. Includes the router for the whole editors and IDEs reference./editor-referenceUse when checking an editor anti-pattern or misconception, looking up a startup, latency or file-size figure, finding the resources, or needing a picker — plus the current state of the AI and agent layer in editors and the editor landscape. Companion to the other editors and IDEs skills./editor-vscode-architecture-and-the-protocol-layerUse when reasoning about why an editor feels slow, why an extension cannot touch the DOM, or how language features actually arrive: VS Code's multi-process architecture and the extension host, settings and workspace configuration precedence, remote development over SSH, containers and WSL, and the protocol layer — the Language Server Protocol, the Debug Adapter Protocol and Tree-sitter incremental parsing — that made editors interchangeable./editor-vscode-extension-developmentUse when building a VS Code extension end to end: the anatomy of an extension and its manifest, contribution points and activation events, the API surfaces for commands, editors, tasks and tree views, webviews with their message passing and content security constraints, writing a language server, and testing and publishing to the marketplace.npx claudepluginhub the-vibey-project/vibey --plugin editors-ide-extension-development