From f4e4f8ef91100ce7a65e18438321db8d35ccfcc2 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Sat, 10 Aug 2024 09:59:23 +0300 Subject: [PATCH] neovim: use typescript-tools instead of typescript-language-server --- neovim/configs/language-server.nix | 16 +--------------- neovim/plugins/default.nix | 1 + neovim/plugins/typescript-tools.nix | 13 +++++++++++++ 3 files changed, 15 insertions(+), 15 deletions(-) create mode 100644 neovim/plugins/typescript-tools.nix diff --git a/neovim/configs/language-server.nix b/neovim/configs/language-server.nix index 6b54640..5d14913 100644 --- a/neovim/configs/language-server.nix +++ b/neovim/configs/language-server.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, ... }: let inherit (lib.nix2lua) call; in { @@ -25,20 +25,6 @@ let inherit (lib.nix2lua) call; in "cargo.autoreload" = true; }; }; - tsserver = rec { - filetypes = [ "javascript" "javascriptreact" "typescript" "typescriptreact" "vue" ]; - cmd = "${pkgs.nodePackages.typescript-language-server}/bin/typescript-language-server --stdio"; - init_options = { - plugins = [ - { - name = "@vue/typescript-plugin"; - location = "./node_modules/@vue/typescript-plugin"; - languages = filetypes; - } - ]; - tsserver.fallbackPath = "${pkgs.nodePackages.typescript}/lib/node_modules/typescript/lib"; - }; - }; eslint = { on_attach = config.fn.lspconfig-eslint-on-attach.lambda; flags = { diff --git a/neovim/plugins/default.nix b/neovim/plugins/default.nix index 5ad1883..7e0dcbd 100644 --- a/neovim/plugins/default.nix +++ b/neovim/plugins/default.nix @@ -1,5 +1,6 @@ { imports = [ ./ollama.nix + ./typescript-tools.nix ]; } diff --git a/neovim/plugins/typescript-tools.nix b/neovim/plugins/typescript-tools.nix new file mode 100644 index 0000000..5825ae1 --- /dev/null +++ b/neovim/plugins/typescript-tools.nix @@ -0,0 +1,13 @@ +{ + plugin.typescript-tools-nvim = { + enable = true; + name = "typescript-tools"; + setupSettings = { + filetypes = [ "javascript" "javascriptreact" "typescript" "typescriptreact" "vue" ]; + settings = { + tsserver_max_memory = "auto"; + tsserver_plugins = [ "@vue/typescript-plugin" ]; + }; + }; + }; +}