2022-08-28 01:33:43 +01:00
|
|
|
{
|
2023-02-20 11:42:13 +01:00
|
|
|
lib,
|
2023-11-06 15:04:08 +01:00
|
|
|
helpers,
|
2023-02-20 11:42:13 +01:00
|
|
|
config,
|
2023-11-06 15:04:08 +01:00
|
|
|
pkgs,
|
2023-02-20 11:42:13 +01:00
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib; let
|
|
|
|
cfg = config.plugins.lsp-lines;
|
|
|
|
in {
|
2022-08-28 01:33:43 +01:00
|
|
|
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";
|
2023-01-19 10:45:15 +00:00
|
|
|
|
2023-01-25 19:46:49 +01:00
|
|
|
package = helpers.mkPackageOption "lsp_lines.nvim" pkgs.vimPlugins.lsp_lines-nvim;
|
2023-01-19 10:45:15 +00:00
|
|
|
|
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
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-02-20 11:42:13 +01:00
|
|
|
config = 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 {
|
2023-02-20 11:42:13 +01:00
|
|
|
extraPlugins = [cfg.package];
|
2022-08-28 01:33:43 +01:00
|
|
|
|
|
|
|
extraConfigLua = ''
|
|
|
|
do
|
|
|
|
require("lsp_lines").setup()
|
|
|
|
|
2023-02-20 11:42:13 +01:00
|
|
|
vim.diagnostic.config(${helpers.toLuaObject diagnosticConfig})
|
2022-08-28 01:33:43 +01:00
|
|
|
end
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|