Configure code completion icons from settings - #63454
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6abb83c774
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| /// Symbols used to represent LSP item kinds in the completions menu. | ||
| /// Each value must be a single Unicode character. Unspecified values inherit | ||
| /// their defaults. | ||
| pub completion_menu_item_kind_symbols: Option<CompletionMenuItemKindSymbols>, |
There was a problem hiding this comment.
Add the required review marker to README
This commit modifies Rust source files, but README.md in the reviewed tree still begins with # Zed instead of the mandatory two-line manual-review marker. Prepend the required > [!IMPORTANT] callout before submitting these source changes.
AGENTS.md reference: AGENTS.md:L16-L16
Useful? React with 👍 / 👎.
SomeoneToIgnore
left a comment
There was a problem hiding this comment.
Thank you, looks nice, let's also adjust docs/src/reference/all-settings.md so zed.dev/docs can get this change shown.
The parent completion_menu_item_kind is missing there too (since #56396), so this PR is a good opportunity to add both.
| kind: Option<CompletionItemKind>, | ||
| item_ix: usize, | ||
| style: &EditorStyle, | ||
| symbols: &CompletionMenuItemKindSymbols, |
There was a problem hiding this comment.
| symbols: &CompletionMenuItemKindSymbols, | |
| render_completion_kind_symbol: &CompletionMenuItemKindSymbols, |
We have so many symbols around so better be specific.
| } | ||
|
|
||
| #[cfg(test)] | ||
| mod tests { |
There was a problem hiding this comment.
Wrong place for the test block — that belongs to the bottom of the module.
| pub completion_menu_scrollbar: ShowScrollbar, | ||
| pub completion_detail_alignment: CompletionDetailAlignment, | ||
| pub completion_menu_item_kind: CompletionMenuItemKind, | ||
| pub completion_menu_item_kind_symbols: CompletionMenuItemKindSymbols, |
There was a problem hiding this comment.
Sibling nested settings (scrollbar, file_diff) resolve into plain structs with per-field .unwrap() in from_settings (line 332 here), while this keeps the content type with Option<char> fields.
Consequence: if default.json ever drops a key, the badge silently disappears instead of failing loudly at startup — that seems dangerous, can we do better?
| // single-letter badge. | ||
| "completion_menu_item_kind": "off", // off, symbol | ||
| // Customize the single-character symbols used for completion item kinds. | ||
| // Symbols must be supported by the UI font or one of its fallbacks. To use |
There was a problem hiding this comment.
Values are not validated beyond "one Unicode scalar value", and the badge is a fixed 12px box (IconSize::XSmall).
Hence, double-width glyphs (CJK, wide emoji) won't fit the badge, and visually-single characters made of several codepoints (✔️, flags, ZWJ emoji) are rejected and silently fall back to the default letter.
Can we do better, log that at least?
Objective
Solution
default.jsonand merge custom from settingsTesting
Scenarios:
completion_menu_item_kind_symbolsblock - default was usedSelf-Review Checklist:
Showcase
When combined with Nerd Font UI font or NF ui font fallback draws icons for completion items.
Release Notes: