Skip to content

refactor: make editor crates easier to navigate - #85

Merged
samwdp merged 8 commits into
masterfrom
cursor/editor-crate-navigation-e162
Sep 6, 2026
Merged

refactor: make editor crates easier to navigate#85
samwdp merged 8 commits into
masterfrom
cursor/editor-crate-navigation-e162

Conversation

@samwdp

@samwdp samwdp commented Sep 5, 2026

Copy link
Copy Markdown
Owner

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-ui only emits the existing DrawCommands.

Module layout (not foo_01.rs)

Numbered include! slices are gone. Files are real mod trees named after what they do:

  • editor-buffer: geometry, buffer (TextBuffer), motion, objects
  • editor-syntax: language, install, registry, query, highlight, rainbow_paren
  • editor-db: types, secrets, connection, engines, service
  • editor-terminal: session, render
  • editor-lsp: registry, workspace_roots, client/{types,manager,session,requests,documents,notifications,completion}
  • editor-dap: client/{types,session,transport}
  • editor-sdl git: shell/git/{fringe,status,commit,staging,diff,log,stash,merge_rebase,remote,pickers,worktree,commands,process}
  • editor-sdl acp: shell/acp/{launch,session,input,manager,runtime,client}
  • shell tests: shell/tests/ with names that do not shadow shell mods (git_status, acp_protocol, markdown_paint, …)

editor-ui chrome is unchanged pixel-wise.

Testing

  • Local: cargo clippy --workspace --all-targets -- -D warnings and cargo test --workspace after dropping every allow(unused_imports).
  • Windows clippy: windows_msvc_target_triple lives in editor-syntax::install; the Windows-only test calls crate::install::windows_msvc_target_triple.
Open in Web Open in Cursor 

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
samwdp marked this pull request as ready for review September 5, 2026 22:56
cursoragent and others added 7 commits September 5, 2026 23:00
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>
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>
@samwdp
samwdp merged commit f9b8cae into master Sep 6, 2026
6 checks passed
@samwdp
samwdp deleted the cursor/editor-crate-navigation-e162 branch September 6, 2026 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants