modules: add typescript-tools plugin
This commit is contained in:
parent
ff8a211f1c
commit
dd5d3cb614
2 changed files with 43 additions and 0 deletions
|
@ -17,6 +17,7 @@
|
|||
./modules/plugins/interface/lualine.nix
|
||||
./modules/plugins/language-server/lspconfig.nix
|
||||
./modules/plugins/language-server/nlsp-settings.nix
|
||||
./modules/plugins/language-server/typescript-tools.nix
|
||||
./modules/plugins/navigation/hop-nvim.nix
|
||||
./modules/plugins/navigation/telescope.nix
|
||||
./modules/plugins/navigation/nvim-tree.nix
|
||||
|
|
42
modules/plugins/language-server/typescript-tools.nix
Normal file
42
modules/plugins/language-server/typescript-tools.nix
Normal file
|
@ -0,0 +1,42 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.plugins.language-server.typescript-tools;
|
||||
in
|
||||
{
|
||||
options.plugins.language-server.typescript-tools = with lib; {
|
||||
enable = lib.mkEnableOption "typescript-tools";
|
||||
|
||||
package = mkPackageOption pkgs.vimPlugins "typescript-tools-nvim" { };
|
||||
|
||||
serverSettings = mkOption {
|
||||
type = with types; attrsOf attrs;
|
||||
default = { };
|
||||
description = ''
|
||||
Server-specific settings.
|
||||
|
||||
See config options here: https://github.com/pmizio/typescript-tools.nvim
|
||||
|
||||
`:help lspconfig-setup`
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = !(config.plugins.language-server.lspconfig.serverSettings ? tsserver);
|
||||
message = "You should not have 'typescript-language-server' and 'typescript-tools' enabled together because they are both LSP for the same language";
|
||||
}
|
||||
];
|
||||
|
||||
plugin.plenary-nvim = { };
|
||||
|
||||
plugin.typescript-tools-nvim = {
|
||||
enable = true;
|
||||
name = "typescript-tools";
|
||||
inherit (cfg) package;
|
||||
setupSettings = cfg.serverSettings;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue