# editor: Extract \`completions\` and \`code_actions\` out of \`editor.rs\` \(\#56030\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/bd2fb74037b8a209c6707a613b1faca227606616)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: bd2fb74037b8a209c6707a613b1faca227606616

Requested commit: bd2fb74037b8a209c6707a613b1faca227606616

Commit: bd2fb74037b8a209c6707a613b1faca227606616

Tree: abed8fa56a3718d68dc0f1a9214006247348fd7c

Author: Mikhail Pertsev

Committer: GitHub

## Message

```
editor: Extract `completions` and `code_actions` out of `editor.rs` (#56030)

cc @SomeoneToIgnore

## Summary

Follow-up to https://github.com/zed-industries/zed/discussions/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
```

## Parents

- [4f54a04147f139db9ca1f51ff30350f59554faab](https://git.cafe/gitcafe/zed/commit/4f54a04147f139db9ca1f51ff30350f59554faab?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/bd2fb74037b8a209c6707a613b1faca227606616?format=markdown)
