mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-23 17:28:39 +02:00
plugins/nvim-lsp: internal rename (nvim-lsp -> lsp)
This commit is contained in:
parent
079b0c30cd
commit
859ae3a843
17 changed files with 8 additions and 8 deletions
47
plugins/lsp/lsp-lines.nix
Normal file
47
plugins/lsp/lsp-lines.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.plugins.lsp-lines;
|
||||
helpers = import ../helpers.nix {inherit lib;};
|
||||
in {
|
||||
options = {
|
||||
plugins.lsp-lines = {
|
||||
enable = mkEnableOption "lsp_lines.nvim";
|
||||
|
||||
package = helpers.mkPackageOption "lsp_lines.nvim" pkgs.vimPlugins.lsp_lines-nvim;
|
||||
|
||||
currentLine = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Show diagnostics only on current line";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = let
|
||||
diagnosticConfig = {
|
||||
virtual_text = false;
|
||||
virtual_lines =
|
||||
if cfg.currentLine
|
||||
then {
|
||||
only_current_line = true;
|
||||
}
|
||||
else true;
|
||||
};
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
extraPlugins = [cfg.package];
|
||||
|
||||
extraConfigLua = ''
|
||||
do
|
||||
require("lsp_lines").setup()
|
||||
|
||||
vim.diagnostic.config(${helpers.toLuaObject diagnosticConfig})
|
||||
end
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue