mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-27 22:24:37 +02:00
plugins/lsp: use new lsp module to implement plugins.lsp.inlayHints (two-way alias)
Some checks are pending
Publish every Git push to main to FlakeHub / flakehub-publish (push) Waiting to run
Publish every git push to Flakestry / publish-flake (push) Waiting to run
Documentation / Version info (push) Waiting to run
Documentation / Build (push) Blocked by required conditions
Documentation / Combine builds (push) Blocked by required conditions
Documentation / Deploy (push) Blocked by required conditions
Some checks are pending
Publish every Git push to main to FlakeHub / flakehub-publish (push) Waiting to run
Publish every git push to Flakestry / publish-flake (push) Waiting to run
Documentation / Version info (push) Waiting to run
Documentation / Build (push) Blocked by required conditions
Documentation / Combine builds (push) Blocked by required conditions
Documentation / Deploy (push) Blocked by required conditions
This commit is contained in:
parent
dff79d34f8
commit
3d09c8eace
1 changed files with 8 additions and 5 deletions
|
@ -108,6 +108,9 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
||||||
|
|
||||||
See [`:h lsp-inlay_hint`](https://neovim.io/doc/user/lsp.html#lsp-inlay_hint).
|
See [`:h lsp-inlay_hint`](https://neovim.io/doc/user/lsp.html#lsp-inlay_hint).
|
||||||
'';
|
'';
|
||||||
|
# When `plugins.lsp` is enabled, definitions are aliased to `lsp.inlayHints.enable`; so read that final value here.
|
||||||
|
# The other half of this two-way alias is below in `extraConfig`.
|
||||||
|
apply = value: if config.plugins.lsp.enable then config.lsp.inlayHints.enable else value;
|
||||||
};
|
};
|
||||||
|
|
||||||
onAttach = mkOption {
|
onAttach = mkOption {
|
||||||
|
@ -177,7 +180,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
||||||
++ mkMaps "vim.lsp.buf." "Lsp buf" cfg.keymaps.lspBuf
|
++ mkMaps "vim.lsp.buf." "Lsp buf" cfg.keymaps.lspBuf
|
||||||
++ cfg.keymaps.extra;
|
++ cfg.keymaps.extra;
|
||||||
|
|
||||||
# Alias onAttach definitions to the new impl in the top-level lsp module.
|
# Alias onAttach and inlayHints definitions to the new impl in the top-level lsp module.
|
||||||
#
|
#
|
||||||
# NOTE: While `mkDerivedConfig` creates an alias based on the final `value` and `highestPrio`,
|
# NOTE: While `mkDerivedConfig` creates an alias based on the final `value` and `highestPrio`,
|
||||||
# `mkAliasAndWrapDefinitions` and `mkAliasAndWrapDefsWithPriority` propagates the un-merged
|
# `mkAliasAndWrapDefinitions` and `mkAliasAndWrapDefsWithPriority` propagates the un-merged
|
||||||
|
@ -190,7 +193,10 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
||||||
# This is equivalent to `mkAliasOptionModule`, except predicated on `plugins.lsp.enable`.
|
# This is equivalent to `mkAliasOptionModule`, except predicated on `plugins.lsp.enable`.
|
||||||
#
|
#
|
||||||
# The other half of this two-way alias is above in the option's `apply` function.
|
# The other half of this two-way alias is above in the option's `apply` function.
|
||||||
lsp.onAttach = lib.modules.mkAliasAndWrapDefsWithPriority lib.id opts.onAttach;
|
lsp = {
|
||||||
|
onAttach = lib.modules.mkAliasAndWrapDefsWithPriority lib.id opts.onAttach;
|
||||||
|
inlayHints.enable = lib.modules.mkAliasAndWrapDefsWithPriority lib.id opts.inlayHints;
|
||||||
|
};
|
||||||
|
|
||||||
plugins.lsp.luaConfig.content =
|
plugins.lsp.luaConfig.content =
|
||||||
let
|
let
|
||||||
|
@ -203,9 +209,6 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
||||||
do
|
do
|
||||||
${cfg.preConfig}
|
${cfg.preConfig}
|
||||||
|
|
||||||
-- inlay hint
|
|
||||||
${lib.optionalString cfg.inlayHints "vim.lsp.inlay_hint.enable(true)"}
|
|
||||||
|
|
||||||
local __lspServers = ${lib.nixvim.toLuaObject cfg.enabledServers}
|
local __lspServers = ${lib.nixvim.toLuaObject cfg.enabledServers}
|
||||||
|
|
||||||
local __lspCapabilities = function()
|
local __lspCapabilities = function()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue