bluloco.nvim icon indicating copy to clipboard operation
bluloco.nvim copied to clipboard

Regarding the color issue of inlay_hint

Open jinzhongjia opened this issue 2 years ago • 15 comments

Its background color is the same as the annotation, so it doesn't look clear enough. Maybe we can make the difference by deepening the background color of inlay_hint.

image

jinzhongjia avatar Oct 19 '23 11:10 jinzhongjia

I see. How about reversing colors? So bg and fg switch?

uloco avatar Oct 19 '23 17:10 uloco

this theme https://github.com/projekt0n/github-nvim-theme do like this: image

I don’t know much about neovim’s color. It seems like the bg is accentuated.

jinzhongjia avatar Oct 20 '23 06:10 jinzhongjia

in https://github.com/Mofiqul/vscode.nvim, like this: image Annotations and inlayhint colors are completely different

jinzhongjia avatar Oct 20 '23 06:10 jinzhongjia

this theme https://github.com/projekt0n/github-nvim-theme do like this: image

I don’t know much about neovim’s color. It seems like the bg is accentuated.

I think we can directly refer to its processing method, and the workload should be minimal.

jinzhongjia avatar Oct 20 '23 06:10 jinzhongjia

this theme https://github.com/projekt0n/github-nvim-theme do like this: image

I don’t know much about neovim’s color. It seems like the bg is accentuated.

I think we can directly refer to its processing method, and the workload should be minimal.

This one looks good

uloco avatar Oct 22 '23 07:10 uloco

I was planning to add this at some point... did you solve it other way or why did you close?

uloco avatar Dec 01 '23 16:12 uloco

This issue hasn't changed for a long time. I thought you didn't plan to add this feature. Now I’m looking forward to the new features in the future

jinzhongjia avatar Dec 02 '23 02:12 jinzhongjia

Just a lot on my plate. But I want to close all issues at some point ;)

uloco avatar Dec 02 '23 09:12 uloco

this theme https://github.com/projekt0n/github-nvim-theme do like this: image

I don’t know much about neovim’s color. It seems like the bg is accentuated.


This theme uses the LspInlayHint highlight group to implement it, here's the code: https://github.com/projekt0n/github-nvim-theme/blob/067cb69b93957ace0d0d83811453b401d1fb672c/lua/github-theme/group/modules/native_lsp.lua#L19

All we need now is a suitable background colour for both the dark theme and the light theme and it should be done.

hankertrix avatar Jan 21 '24 14:01 hankertrix

I want to test this but couldn't figure out how to enable the inlay hints....

uloco avatar Jan 22 '24 12:01 uloco

I looked around and found that inlay hints are a Neovim nightly feature. https://github.com/nvimdev/lspsaga.nvim/issues/1204

He uses his own plugin called LspUI in his configuration, and I'm not sure if his plugin uses Neovim nightly or Neovim stable, but installing his plugin might allow you to test it: https://github.com/jinzhongjia/LspUI.nvim

@jinzhongjia would you mind providing a minimal config to display the inlay hints as well as some code examples to test it?

hankertrix avatar Jan 23 '24 05:01 hankertrix

first, add this to lua_ls config(I use nevim-lspconfig), this will request lua_ls enable inlay_hint feature

    settings = {
        Lua = {
            hint = {
                enable = true,
                arrayIndex = "Enable",
                setType = true,
            },
            workspace = {
                checkThirdParty = false,
            },
        },
    },

Then install neovim nightly, and you can use this to enable inlay_hint easily: :lua vim.lsp.inlay_hint.enable(0, true) It will enable inlay_hint for current buffer(current buffer be represented by 0 )

use this to disable inaly_hint :lua vim.lsp.inlay_hint.enable(0, false)

jinzhongjia avatar Jan 23 '24 05:01 jinzhongjia

The inlay_hint of my plugin is just a package for the official function, which is more convenient for management (such as opening and closing different types of files and temporarily closing them)

jinzhongjia avatar Jan 23 '24 05:01 jinzhongjia

image

just like this

jinzhongjia avatar Jan 23 '24 05:01 jinzhongjia

I think these are enough for testing without the need to install additional plugins

jinzhongjia avatar Jan 23 '24 06:01 jinzhongjia

I want to test this but couldn't figure out how to enable the inlay hints....

@uloco Neovim stable has updated to 0.10.0 and inlay hints should be easily testable now.

hankertrix avatar Jun 02 '24 08:06 hankertrix