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

  cfg = config.vim.lsp.presets.ts-query-ls;
in {
  options.vim.lsp.presets.ts-query-ls = {
    enable = mkLspPresetEnableOption {
      option = "ts-query-ls";
      display = "Treesitter Query";
    };
  };

  config = mkIf cfg.enable {
    vim.lsp.servers.ts-query-ls = {
      enable = true;
      cmd = [(getExe pkgs.ts_query_ls)];
    };
  };
}