editor: Extract completions and code_actions out of editor.rs - #56030
Conversation
completions and code_actions out of editor.rs
SomeoneToIgnore
left a comment
There was a problem hiding this comment.
impl Editor are not grouped still; fn and pub(super) fn and maybe others seem to be mixed, not ordered.
I see. I misunderstood your point, now with the latest changes this: #[cfg(any(test, feature = "test-support"))]
impl Editor {
// ...
}Is next to the "main"
Right now both "main"
I tried to use the same pattern as in |
|
|
Agreed. I moved the |
670cc12 to
7dd78d7
Compare
…ries#56070) cc @SomeoneToIgnore ## Summary Follow-up to zed-industries#56030 This mechanically extracts two editor topics into focused sibling modules: - `crates/editor/src/fold.rs` - `crates/editor/src/selection.rs` One odd boundary remains: several selection state types still live in `editor.rs`. I didn't move them because those caused that "huge 11k diff" in the previous PR, so I propose to move them later. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A
…ed-industries#56030) cc @SomeoneToIgnore ## Summary Follow-up to zed-industries#55352, where the conclusion was to split `editor.rs` incrementally by topic instead of all at once. This mechanically extracts two editor topics into focused sibling modules: - `crates/editor/src/code_actions.rs` - `crates/editor/src/completions.rs` One odd boundary remains: `Editor::context_menu()` is still a general context-menu accessor, but it now lives in `code_actions.rs` because it was part of the moved code actions block and is also used by completions, Vim tests, agent UI, and the quick action bar. Would you prefer that generic context-menu accessor stay in `editor.rs` for now until context-menu code gets its own extraction? ## Testing - `cargo check -p editor --lib` - `cargo check -p editor --tests` - `cargo check -p editor --lib --features test-support` Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A
…ries#56070) cc @SomeoneToIgnore ## Summary Follow-up to zed-industries#56030 This mechanically extracts two editor topics into focused sibling modules: - `crates/editor/src/fold.rs` - `crates/editor/src/selection.rs` One odd boundary remains: several selection state types still live in `editor.rs`. I didn't move them because those caused that "huge 11k diff" in the previous PR, so I propose to move them later. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A
…ed-industries#56030) cc @SomeoneToIgnore ## Summary Follow-up to zed-industries#55352, where the conclusion was to split `editor.rs` incrementally by topic instead of all at once. This mechanically extracts two editor topics into focused sibling modules: - `crates/editor/src/code_actions.rs` - `crates/editor/src/completions.rs` One odd boundary remains: `Editor::context_menu()` is still a general context-menu accessor, but it now lives in `code_actions.rs` because it was part of the moved code actions block and is also used by completions, Vim tests, agent UI, and the quick action bar. Would you prefer that generic context-menu accessor stay in `editor.rs` for now until context-menu code gets its own extraction? ## Testing - `cargo check -p editor --lib` - `cargo check -p editor --tests` - `cargo check -p editor --lib --features test-support` Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A
…ries#56070) cc @SomeoneToIgnore ## Summary Follow-up to zed-industries#56030 This mechanically extracts two editor topics into focused sibling modules: - `crates/editor/src/fold.rs` - `crates/editor/src/selection.rs` One odd boundary remains: several selection state types still live in `editor.rs`. I didn't move them because those caused that "huge 11k diff" in the previous PR, so I propose to move them later. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A
cc @SomeoneToIgnore
Summary
Follow-up to #55352, where the conclusion was to split
editor.rsincrementally by topic instead of all at once.This mechanically extracts two editor topics into focused sibling modules:
crates/editor/src/code_actions.rscrates/editor/src/completions.rsOne odd boundary remains:
Editor::context_menu()is still a general context-menu accessor, but it now lives incode_actions.rsbecause it was part of the moved code actions block and is also used by completions, Vim tests, agent UI, and the quick action bar. Would you prefer that generic context-menu accessor stay ineditor.rsfor now until context-menu code gets its own extraction?Testing
cargo check -p editor --libcargo check -p editor --testscargo check -p editor --lib --features test-supportSelf-Review Checklist:
Release Notes: