mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-01-19 16:32:24 +00:00
lspkind: integration with blink.cmp
This commit is contained in:
parent
9667610e7c
commit
8e1dbc7df2
1 changed files with 18 additions and 6 deletions
|
@ -8,16 +8,18 @@
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
|
||||||
cfg = config.vim.lsp.lspkind;
|
cfg = config.vim.lsp.lspkind;
|
||||||
|
usingCmp = config.vim.autocomplete.nvim-cmp.enable;
|
||||||
|
usingBlink = config.vim.autocomplete.blink-cmp.enable;
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
assertions = [
|
assertions = [
|
||||||
{
|
{
|
||||||
assertion = config.vim.autocomplete.nvim-cmp.enable;
|
assertion = usingCmp || usingBlink;
|
||||||
message = ''
|
message = ''
|
||||||
While lspkind supports Neovim's native lsp upstream, using that over
|
While lspkind supports Neovim's native lsp upstream, using that over
|
||||||
nvim-cmp isn't recommended, nor supported by nvf.
|
nvim-cmp/blink.cmp isn't recommended, nor supported by nvf.
|
||||||
|
|
||||||
Please migrate to nvim-cmp if you want to use lspkind.
|
Please migrate to nvim-cmp/blink.cmp if you want to use lspkind.
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
@ -26,9 +28,19 @@ in {
|
||||||
startPlugins = ["lspkind"];
|
startPlugins = ["lspkind"];
|
||||||
|
|
||||||
lsp.lspkind.setupOpts.before = config.vim.autocomplete.nvim-cmp.format;
|
lsp.lspkind.setupOpts.before = config.vim.autocomplete.nvim-cmp.format;
|
||||||
autocomplete.nvim-cmp.setupOpts.formatting.format = mkForce (mkLuaInline ''
|
autocomplete = {
|
||||||
|
nvim-cmp = mkIf usingCmp {
|
||||||
|
setupOpts.formatting.format = mkForce (mkLuaInline ''
|
||||||
require("lspkind").cmp_format(${toLuaObject cfg.setupOpts})
|
require("lspkind").cmp_format(${toLuaObject cfg.setupOpts})
|
||||||
'');
|
'');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
blink-cmp = mkIf usingBlink {
|
||||||
|
setupOpts.appearance.kind_icons = mkLuaInline ''
|
||||||
|
require("lspkind").symbol_map
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue