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

Add ability to display backgrounds for inlay hints #18010

Merged

Conversation

maxdeviant
Copy link
Member

@maxdeviant maxdeviant commented 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:

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

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

Disabled Enabled
Screenshot 2024-09-17 at 4 21 53 PM Screenshot 2024-09-17 at 4 21 43 PM

Related issues:

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.

@maxdeviant maxdeviant self-assigned this Sep 18, 2024
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Sep 18, 2024
@AlbertMarashi
Copy link
Contributor

would love to see this for predictive texts as well, because it helps me distinguish the generated code vs my actual code

@maxdeviant
Copy link
Member Author

would love to see this for predictive texts as well, because it helps me distinguish the generated code vs my actual code

We can handle predictive text separately. I just wanted to focus on inlay hints, for now.

@maxdeviant maxdeviant merged commit 373a17a into main Sep 18, 2024
11 checks passed
@maxdeviant maxdeviant deleted the marshall/add-setting-to-display-inlay-hint-backgrounds branch September 18, 2024 15:11
@AlbertMarashi
Copy link
Contributor

@maxdeviant did you have an issue by any chance where inlay hint backgrounds were laid over the user selections, making the selection background invisible?

@HamzaFarhan
Copy link

HamzaFarhan commented Sep 25, 2024

@maxdeviant did you have an issue by any chance where inlay hint backgrounds were laid over the user selections, making the selection background invisible?

Yes. I kind of solved it using this but I would love a better solution:

"experimental.theme_overrides": {
    "predictive": "#FF0000"
}

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