summaryrefslogtreecommitdiffstats
path: root/modules/plugins/lsp/presets/python-lsp-server.nix
blob: 09882157b6a5dff56e204d628158462bb36c79d8 (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
{
  config,
  lib,
  pkgs,
  ...
}: let
  inherit (lib.modules) mkIf;
  inherit (lib.nvim.types) mkLspPresetEnableOption;
  inherit (lib.meta) getExe;

  cfg = config.vim.lsp.presets.python-lsp-server;
in {
  options.vim.lsp.presets.python-lsp-server = {
    enable = mkLspPresetEnableOption {
      option = "python-lsp-server";
      display = "Python";
    };
  };

  config = mkIf cfg.enable {
    vim.lsp.servers.python-lsp-server = {
      enable = true;
      cmd = [(getExe pkgs.python3Packages.python-lsp-server)];
      root_markers = [".git"];
    };
  };
}