Compare commits

...

2 commits

3 changed files with 46 additions and 3 deletions

View file

@ -35,11 +35,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1714656196,
"narHash": "sha256-kjQkA98lMcsom6Gbhw8SYzmwrSo+2nruiTcTZp5jK7o=",
"lastModified": 1723221148,
"narHash": "sha256-7pjpeQlZUNQ4eeVntytU3jkw9dFK3k1Htgk2iuXjaD8=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "94035b482d181af0a0f8f77823a790b256b7c3cc",
"rev": "154bcb95ad51bc257c2ce4043a725de6ca700ef6",
"type": "github"
},
"original": {

View file

@ -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

View 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;
};
};
}