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

Support text coloring and background coloring for inlay hints #12485

Open
1 task done
meocoder31099 opened this issue May 30, 2024 · 3 comments
Open
1 task done

Support text coloring and background coloring for inlay hints #12485

meocoder31099 opened this issue May 30, 2024 · 3 comments
Labels
enhancement [core label] inlay hints theme Feedback for theme configuration, accessibility, visual issues, etc

Comments

@meocoder31099
Copy link

meocoder31099 commented May 30, 2024

Check for existing issues

  • Completed

Describe the feature

In VSCode and Helix, I noticed they support separate text coloring and background coloring for inlay hints. I also noticed that hint.background exists in Zed's color scheme, but it doesn't seem to work.

If applicable, add mockups / screenshots to help present your vision of the feature

In VSCode, it looks like this

Screenshot 2024-05-30 at 21 40 52

@meocoder31099 meocoder31099 added admin read Pending admin review enhancement [core label] triage Maintainer needs to classify the issue labels May 30, 2024
@SomeoneToIgnore
Copy link
Contributor

Very related to #11220 and seems like a duplicate.

@JosephTLyons JosephTLyons added theme Feedback for theme configuration, accessibility, visual issues, etc inlay hints and removed triage Maintainer needs to classify the issue admin read Pending admin review labels May 31, 2024
@meocoder31099
Copy link
Author

meocoder31099 commented Jun 8, 2024

My weekend was fantastic, I found the place to do what I wanted in Zed's source code

Screenshot 2024-06-08 at 15 22 52

@khongdudinhdoikhongne
Copy link

This is great when coding with Rust. I like using themes where the hint text color matches the type text color, but sometimes it confuses me when I can't easily distinguish between a hint and a clearly declared type

maxdeviant added a commit that referenced this issue Sep 18, 2024
This PR adds the ability to display backgrounds for inlay hints within
the editor.

This is controlled by the new `inlay_hints.show_background` setting.
This setting defaults to `false`.

To enable the setting, add the following to your `settings.json`:

```json
{
  "inlay_hints": {
    "enabled": true,
    "show_background": true
  }
}
```

When enabled, the inlay hint backgrounds will use the `hint.background`
color from the theme.

| Disabled | Enabled |
|
--------------------------------------------------------------------------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------------------------------------------------------------------------
|
| <img width="1624" alt="Screenshot 2024-09-17 at 4 21 53 PM"
src="https://github.com/user-attachments/assets/5534d09b-1e22-4c6f-9d82-314796ed7d22">
| <img width="1624" alt="Screenshot 2024-09-17 at 4 21 43 PM"
src="https://github.com/user-attachments/assets/6ec58cde-6115-4db4-be95-97c5f2f54b2d">
|

Related issues:

- #12485
- #17392

Release Notes:

- Added an `inlay_hints.show_background` setting to allow displaying
backgrounds for inlay hints in the editor.
  - This setting defaults to `false`.
- If enabled, the inlay hint backgrounds will use the `hint.background`
color from the theme.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement [core label] inlay hints theme Feedback for theme configuration, accessibility, visual issues, etc
Projects
None yet
Development

No branches or pull requests

4 participants