Skip to content

Commit 2e559d3

Browse files
committed
plugins/lsp: simplify implementation of inlayHints
1 parent b72ba2e commit 2e559d3

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

plugins/lsp/default.nix

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
113113
type = types.bool;
114114
default = false;
115115
description = ''
116-
Whether to enable LSP inlay-hints.
117-
Only affects language servers with inlay-hints support.
116+
Whether to enable LSP inlay-hints globally.
118117
119118
See [`:h lsp-inlay_hint`](https://neovim.io/doc/user/lsp.html#lsp-inlay_hint).
120119
'';
@@ -189,14 +188,6 @@ lib.nixvim.plugins.mkNeovimPlugin {
189188
# being properly configured (missing some keys: `cmd`, `filetypes`, `root_markers` etc.)
190189
performance.combinePlugins.standalonePlugins = [ cfg.package ];
191190

192-
plugins.lsp.onAttach = lib.mkIf cfg.inlayHints ''
193-
-- LSP Inlay Hints {{{
194-
if client.server_capabilities.inlayHintProvider and vim.lsp.inlay_hint then
195-
vim.lsp.inlay_hint.enable(true, { bufnr = bufnr })
196-
end
197-
-- }}}
198-
'';
199-
200191
plugins.lsp.luaConfig.content =
201192
let
202193
runWrappers =
@@ -227,6 +218,9 @@ lib.nixvim.plugins.mkNeovimPlugin {
227218
do
228219
${cfg.preConfig}
229220
221+
-- inlay hint
222+
${lib.optionalString cfg.inlayHints "vim.lsp.inlay_hint.enable(true)"}
223+
230224
local __lspServers = ${lib.nixvim.toLuaObject cfg.enabledServers}
231225
-- Adding lspOnAttach function to nixvim module lua table so other plugins can hook into it.
232226
_M.lspOnAttach = function(client, bufnr)

0 commit comments

Comments
 (0)