refactor: make editor crates easier to navigate - #85
Merged
Conversation
Move inline tests into sibling files, break oversized modules into smaller include files, and add editor-ui so overlay/panel chrome is shared without changing draw output. Co-authored-by: samwdp <samwdp@gmail.com>
samwdp
marked this pull request as ready for review
September 5, 2026 22:56
Strip the extra leading blank line rustfmt rejects, and pull leftover #[cfg(test)] modules out of editor-ui, editor-theme, editor-tool-install, editor-syntax, and editor-terminal. Co-authored-by: samwdp <samwdp@gmail.com>
Numbered include files (buffer_01.rs, git_02.rs) were mechanical line
splits, not a module tree. Split by concern instead: geometry vs buffer
vs motion vs objects, LSP client/{types,session,requests,...}, git
status/commit/diff/stash, and similarly named test modules.
Co-authored-by: samwdp <samwdp@gmail.com>
The named split still left TextBuffer on geometry.rs. The struct now lives with buffer.rs; snapshot line helpers stay with geometry. Co-authored-by: samwdp <samwdp@gmail.com>
Co-authored-by: samwdp <samwdp@gmail.com>
The Windows-only syntax test still called super:: after the helper moved into the install module, so clippy --all-targets failed on windows-latest. Co-authored-by: samwdp <samwdp@gmail.com>
The named-module split copied parent use lists into every file and silenced clippy with allow(unused_imports). Those attributes are gone. Each module now imports what it uses; test-only git/acp names are re-exported under cfg(test) instead of a crate-wide allow. Co-authored-by: samwdp <samwdp@gmail.com>
Drop allow(deprecated) by sending LSP workspaceFolders instead of rootUri. Split Windows-only mut/assignment so unused_mut and unused_assignments do not need cfg_attr allows. Terminate supervised children with cfg-specific functions instead of unused_variables. Co-authored-by: samwdp <samwdp@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Editor crates were hard to read: tests sat in the same files as production code, and several modules were thousands of lines. This change extracts tests, splits production code by domain into named modules and submodules (not numbered slices), and moves shared chrome widgets into
editor-ui.Rendering output is meant to stay the same: callers still apply window/overlay opacity to colors first, and
editor-uionly emits the existingDrawCommands.Module layout (not
foo_01.rs)Numbered
include!slices are gone. Files are realmodtrees named after what they do:editor-buffer:geometry,buffer(TextBuffer),motion,objectseditor-syntax:language,install,registry,query,highlight,rainbow_pareneditor-db:types,secrets,connection,engines,serviceeditor-terminal:session,rendereditor-lsp:registry,workspace_roots,client/{types,manager,session,requests,documents,notifications,completion}editor-dap:client/{types,session,transport}editor-sdlgit:shell/git/{fringe,status,commit,staging,diff,log,stash,merge_rebase,remote,pickers,worktree,commands,process}editor-sdlacp:shell/acp/{launch,session,input,manager,runtime,client}shell/tests/with names that do not shadow shell mods (git_status,acp_protocol,markdown_paint, …)editor-uichrome is unchanged pixel-wise.Testing
cargo clippy --workspace --all-targets -- -D warningsandcargo test --workspaceafter dropping everyallow(unused_imports).windows_msvc_target_triplelives ineditor-syntax::install; the Windows-only test callscrate::install::windows_msvc_target_triple.