Skip to content

editor: Extract Diagnostics code out of editor.rs - #55747

Merged
SomeoneToIgnore merged 4 commits into
zed-industries:mainfrom
GoldStrikeArch:feat/extract-diagnostics-out-of-editor
May 5, 2026
Merged

editor: Extract Diagnostics code out of editor.rs#55747
SomeoneToIgnore merged 4 commits into
zed-industries:mainfrom
GoldStrikeArch:feat/extract-diagnostics-out-of-editor

Conversation

@GoldStrikeArch

@GoldStrikeArch GoldStrikeArch commented May 5, 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 mechanically extracts diagnostics-related editor code into crates/editor/src/editor/diagnostics.rs while preserving the existing public API via re-exports.

Testing

  • cargo check -p editor --lib
  • cargo check -p diagnostics --lib
  • cargo check -p diagnostics --tests

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 5, 2026
@SomeoneToIgnore SomeoneToIgnore self-assigned this May 5, 2026

@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.

Great, thank you for the example, the idea seems to be well demonstrated and great if we can process each move sequentially, making some notes between steps if necessary.

Here, some overly public members are somewhat odd to expose: let's check out the usages of each entry moved and see if that could be inlined/made private/etc.
In some cases, cargo does not emit warnings for items that are pub but not used anywhere, so it's nice to make some tidy up if we're onto it anyway.

Comment thread crates/editor/src/editor.rs Outdated
Comment thread crates/editor/src/editor/diagnostics.rs Outdated
@ChristopherBiscardi ChristopherBiscardi added area:editor Feedback for code editing, formatting, editor iterations, etc area:diagnostics Feedback for diagnostics, error messages, logs, etc labels May 5, 2026
@GoldStrikeArch

Copy link
Copy Markdown
Contributor Author

@SomeoneToIgnore

Thanks, agreed. I tightened this up by:

  • removing the public re-exports for diagnostic_style and ActiveDiagnosticGroup
  • moving diagnostic_style into display_map as a private helper
  • moving the pub(super) diagnostics helpers below the public methods

I kept the remaining public methods because they still have cross-crate callers from diagnostics, git_ui, agent_ui, etc.

@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.

Nice, thank you.

@SomeoneToIgnore
SomeoneToIgnore enabled auto-merge May 5, 2026 15:39
@SomeoneToIgnore
SomeoneToIgnore added this pull request to the merge queue May 5, 2026
Merged via the queue into zed-industries:main with commit 1da60a8 May 5, 2026
31 checks passed
ebaah46 pushed a commit to ebaah46/zed that referenced this pull request May 6, 2026
…5747)

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 diagnostics-related editor code into
`crates/editor/src/editor/diagnostics.rs` while preserving the existing
public API via re-exports.

## Testing

- `cargo check -p editor --lib`
- `cargo check -p diagnostics --lib`
- `cargo check -p diagnostics --tests`

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
@GoldStrikeArch
GoldStrikeArch deleted the feat/extract-diagnostics-out-of-editor branch May 7, 2026 18:26
jonx pushed a commit to jonx/zed-aros that referenced this pull request Jul 17, 2026
…5747)

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 diagnostics-related editor code into
`crates/editor/src/editor/diagnostics.rs` while preserving the existing
public API via re-exports.

## Testing

- `cargo check -p editor --lib`
- `cargo check -p diagnostics --lib`
- `cargo check -p diagnostics --tests`

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
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
…5747)

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 diagnostics-related editor code into
`crates/editor/src/editor/diagnostics.rs` while preserving the existing
public API via re-exports.

## Testing

- `cargo check -p editor --lib`
- `cargo check -p diagnostics --lib`
- `cargo check -p diagnostics --tests`

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:diagnostics Feedback for diagnostics, error messages, logs, etc area:editor Feedback for code editing, formatting, editor iterations, etc cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants