summaryrefslogtreecommitdiffstats
path: root/modules/plugins/lsp/lspsaga/lspsaga.nix
blob: f70c8c9d097ac5655db67cd5241aa577bf8bf859 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{
  config,
  lib,
  ...
}: let
  inherit (lib.modules) mkRemovedOptionModule;
  inherit (lib.options) mkOption mkEnableOption;
  inherit (lib.nvim.types) borderType mkPluginSetupOption;
  inherit (lib.nvim.lua) mkLuaInline;

  uiKindSetupOpts =
    if config.vim.theme.enable && config.vim.theme.name == "catppuccin"
    then {
      ui.kind = mkLuaInline ''
        require("catppuccin.groups.integrations.lsp_saga").custom_kind()
      '';
    }
    else {};
in {
  imports = [
    (mkRemovedOptionModule ["vim" "lsp" "lspsaga" "mappings"] ''
      Lspsaga mappings have been removed from nvf, as the original author has made
      very drastic changes to the API after taking back ownership, and the fork we
      used is now archived. Please refer to Lspsaga documentation to add keybinds
      for functionality you have used.

      <https://nvimdev.github.io/lspsaga>
    '')
  ];

  options.vim.lsp.lspsaga = {
    enable = mkEnableOption "LSP Saga";

    setupOpts =
      mkPluginSetupOption "lspsaga" {
        border_style = mkOption {
          type = borderType;
          default = config.vim.ui.borders.globalStyle;
          description = "Border type, see {command}`:help nvim_open_win`";
        };
      }
      // uiKindSetupOpts;
  };
}