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

Option to enable inlay-hints #655

Open
1 task done
madser123 opened this issue Feb 20, 2025 · 4 comments
Open
1 task done

Option to enable inlay-hints #655

madser123 opened this issue Feb 20, 2025 · 4 comments

Comments

@madser123
Copy link

⚠️ Please verify that this feature request has NOT been suggested before.

  • I checked and didn't find a similar feature request

🏷️ Feature Type

API Additions

🔖 Feature description

For rust (especially) and some other languages, it is essential for many users to have the inlay-hints introduced in nvim 0.10 enabled. However, they aren't by default. I can't seem to find a way to enable them in the Appendix.

✔️ Solution

Adding the option vim.lsp.inlay-hint.enable to the flake

❓ Alternatives

Any other way to add to the on_attach function for the lsp would also suffice

📝 Additional Context

I haven't been able to find an option that enables this - And i can't seem to figure out how to add it manually to the on_attach hook for the lsp. If there is a way to do either of these, please tell! 😄

@NotAShelf
Copy link
Owner

Right now we don't have granular controls for LSP/diagnostic components of Neovim itself. This is a part of the debt we inherited on fork, but I'm currently looking to close those gaps.

As a temporary workaround, you can use vim.luaConfigRC or vim.luaConfig{Pre,Post} to configure it using Lua, at least until I get to making vim's internal LSP configuration more modular.

There is #643 which I can sneak lsp configuration options into, but with Neovim 0.11 lspconfig will be obsolete, and I'd much rather rework everything then. Again, configuring it via Lua should do the trick for now.

@madser123
Copy link
Author

madser123 commented Feb 20, 2025

I will look into vim.luaConfig.. - No reason for you to hack something together now, if a rework will be needed soon 👍

Appreciate the quick response! I'll leave the issue open in case you want it as a reminder of the request - That's up to you :)

@NotAShelf
Copy link
Owner

I'll keep it open as a mental note for myself, I tend to forget things otherwise 😔

@madser123
Copy link
Author

To anyone else stumbling upon this, i got this working in the home-manager module using:

programs.nvf.settings.vim.luaConfigPre = ''
  vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled(), { bufnr })
'';

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

No branches or pull requests

2 participants