Skip to content

Configure code completion icons from settings - #63454

Open
prathoss wants to merge 1 commit into
zed-industries:mainfrom
prathoss:configurable-completion-icons
Open

Configure code completion icons from settings#63454
prathoss wants to merge 1 commit into
zed-industries:mainfrom
prathoss:configurable-completion-icons

Conversation

@prathoss

Copy link
Copy Markdown

Objective

Solution

  • Keep hardcoded characters as default.json and merge custom from settings

Testing

Scenarios:

  • Without configuration - default was used
  • Only certain fields in configuration - only configured fields were updated
  • Empty completion_menu_item_kind_symbols block - default was used
  • A word as a symbol - only invalid completion kind fall back to default

Self-Review Checklist:

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

Showcase

When combined with Nerd Font UI font or NF ui font fallback draws icons for completion items.

image

Release Notes:

  • Added configurable code completion icons

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Aug 30, 2026
@zed-community-bot zed-community-bot Bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Aug 30, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 30, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-30T17:43:28.351722Z 6abb83c PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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>,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 SomeoneToIgnore self-assigned this Aug 30, 2026
@ChristopherBiscardi ChristopherBiscardi added area:design papercut Small visual defects area:settings Feedback for preferences, configuration, etc labels Aug 31, 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.

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,

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.

Suggested change
symbols: &CompletionMenuItemKindSymbols,
render_completion_kind_symbol: &CompletionMenuItemKindSymbols,

We have so many symbols around so better be specific.

}

#[cfg(test)]
mod tests {

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.

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,

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.

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

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.

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?

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

Labels

area:design papercut Small visual defects area:settings Feedback for preferences, configuration, etc cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants