2022-08-28 01:33:43 +01:00
|
|
|
{ pkgs, lib, config, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
2022-09-18 11:19:23 +01:00
|
|
|
cfg = config.plugins.lsp-lines;
|
2022-08-28 01:33:43 +01:00
|
|
|
helpers = import ../helpers.nix { lib = lib; };
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
2022-09-18 11:19:23 +01:00
|
|
|
plugins.lsp-lines = {
|
2022-08-28 01:33:43 +01:00
|
|
|
enable = mkEnableOption "lsp_lines.nvim";
|
2022-12-11 19:39:45 +00:00
|
|
|
currentLine = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = "Show diagnostics only on current line";
|
|
|
|
};
|
2022-08-28 01:33:43 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-09-18 11:19:23 +01:00
|
|
|
config =
|
2022-12-11 19:39:45 +00:00
|
|
|
let
|
|
|
|
diagnosticConfig = {
|
|
|
|
virtual_text = false;
|
|
|
|
virtual_lines =
|
|
|
|
if cfg.currentLine then {
|
|
|
|
only_current_line = true;
|
|
|
|
} else true;
|
|
|
|
};
|
|
|
|
in
|
2022-08-28 01:33:43 +01:00
|
|
|
mkIf cfg.enable {
|
|
|
|
extraPlugins = [ pkgs.vimPlugins.lsp_lines-nvim ];
|
|
|
|
|
|
|
|
extraConfigLua = ''
|
|
|
|
do
|
|
|
|
require("lsp_lines").setup()
|
|
|
|
|
2022-12-11 19:39:45 +00:00
|
|
|
vim.diagnostic.config(${ helpers.toLuaObject diagnosticConfig })
|
2022-08-28 01:33:43 +01:00
|
|
|
end
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|