summaryrefslogtreecommitdiffstats
path: root/modules/plugins/lsp/presets/just-lsp.nix
blob: d5372cb0af8ecdf1303b92540812a8e6f5b56fbe (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.just-lsp;
in {
  options.vim.lsp.presets.just-lsp = {
    enable = mkLspPresetEnableOption {
      option = "just-lsp";
      display = "Just";
    };
  };

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