Skip to content

editor: Extract fold, selection, coade_actions and completions out of editor.rs - #56010

Closed
GoldStrikeArch wants to merge 1 commit into
zed-industries:mainfrom
GoldStrikeArch:feat/extract-fold-completions-codeactions-selection-out-of-editor
Closed

editor: Extract fold, selection, coade_actions and completions out of editor.rs#56010
GoldStrikeArch wants to merge 1 commit into
zed-industries:mainfrom
GoldStrikeArch:feat/extract-fold-completions-codeactions-selection-out-of-editor

Conversation

@GoldStrikeArch

@GoldStrikeArch GoldStrikeArch commented May 7, 2026

Copy link
Copy Markdown
Contributor

cc @SomeoneToIgnore

Summary

Follow-up to #55352, where the conclusion was to split editor.rs incrementally by topic instead of all at once.

This extracts several editor topics into focused sibling modules:

  • crates/editor/src/fold.rs
  • crates/editor/src/code_actions.rs
  • crates/editor/src/completions.rs
  • crates/editor/src/selection.rs

While doing the extraction, this also tightens the module boundaries instead of preserving every old access path by inertia:

  • Avoids exposing the raw context_menu storage and replaces external usage with focused APIs for code actions and completions state.
  • Keeps broad editor editing/cancel behavior in editor.rs, since those APIs are not selection-specific.
  • Moves linked-editing range lookup into linked_editing_ranges.rs, closer to its only real caller.

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Release Notes:

  • N/A

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label May 7, 2026
@GoldStrikeArch
GoldStrikeArch marked this pull request as draft May 7, 2026 07:21
@GoldStrikeArch
GoldStrikeArch marked this pull request as ready for review May 7, 2026 08:24

@SomeoneToIgnore SomeoneToIgnore left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

Hard "nope", sorry.

One of the points is to keep things mechanical enough to review quickly and this is not the case now.
Also, why there's so many + in that particular file, seems odd?

@GoldStrikeArch

Copy link
Copy Markdown
Contributor Author

Also, why there's so many + in that particular file, seems odd?

Yeah, this is weird. It should be -4k lines. I guess there is some re-ordering I introduced. I will try to fix it

@GoldStrikeArch GoldStrikeArch changed the title [draft]: initial extracting of fold, selection, coade_actions and comple… editor: Extract fold, selection, coade_actions and completions out of editor.rs May 7, 2026
@GoldStrikeArch
GoldStrikeArch force-pushed the feat/extract-fold-completions-codeactions-selection-out-of-editor branch 2 times, most recently from d7b9960 to 0b7fcd7 Compare May 7, 2026 09:21
@GoldStrikeArch
GoldStrikeArch force-pushed the feat/extract-fold-completions-codeactions-selection-out-of-editor branch from 0b7fcd7 to c63c660 Compare May 7, 2026 09:40
@GoldStrikeArch

Copy link
Copy Markdown
Contributor Author

@SomeoneToIgnore

Looks like something is wrong with the diffing here from the Github/git because on my branch git diff --minimal showed 12 insertions(+), 4610 deletions(-)

I can't solve it for some reason, so I decided to break them up into 2 sequential PRs, this is the first one -> #56030

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants