Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sources): allow setting kind_name and kind_icon in provider config #1329

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andreihh
Copy link
Contributor

Setting the kind_name and kind_icon on every item requires overriding the transform_items function, which can get tedious. Oftenly, custom sources provide only one item kind (e.g., blink-copilot, blink-emoji, blink-cmp-env, blink-ripgrep, css-vars.nvim, blink-cmp-spell).

Allow providers to specify a default kind_name and kind_icon to apply to all of its returned items. These should have lower priority than the kind_name and kind_icon set explicitly on returned items, but higher priority than globals (e.g., appearance.kind_icons). This allows providers to set finer-grained kind_name or kind_icon on an item-by-item basis, but also simplifies logic for providers with only one kind.

NOTE: I tested the changes locally and it seems to work.

Setting the kind_name and kind_icon on every item requires overriding
the transform_items function, which can get tedious. Oftenly, custom
sources provide only one item kind (e.g., blink-copilot, blink-emoji,
blink-cmp-env, blink-ripgrep, css-vars.nvim, blink-cmp-spell).

Allow providers to specify a default kind_name and kind_icon to apply to
all of its returned items. These should have lower priority than the
kind_name and kind_icon set explicitly on returned items, but higher
priority than globals (e.g., appearance.kind_icons). This allows
providers to set finer-grained kind_name or kind_icon on an item-by-item
basis, but also simplifies logic for providers with only one kind.
@Kaiser-Yang
Copy link
Contributor

Kaiser-Yang commented Feb 28, 2025

There is no need to do this, actually with kind_name and kind_icon in blink completion item type. The provider can provide when generating the items, so I think it should be done by the providers' developers to add configuration for users to specify icons rather than the users. BTW, this configuration option can not work for multi types and icons for one provider, such as blink-cmp-git for open, closed, and merged prs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants