diff --git a/nix/sources.json b/nix/sources.json index be37d71..a1543c7 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -221,12 +221,6 @@ "rev": "c2a9e81699021f4ccaac7c574cc42ca4211a499a", "type": "git" }, - "neodev.nvim": { - "branch": "main", - "repo": "git@github.com:folke/neodev.nvim", - "rev": "a4b6e7ca11ff5be2264d5c169fcedd97d8699ec4", - "type": "git" - }, "nui.nvim": { "branch": "main", "repo": "git@github.com:muniftanjim/nui.nvim", @@ -473,6 +467,12 @@ "rev": "8b7b50c0cb2dc781b2f4262a5ddd57571556d1e4", "type": "git" }, + "typescript-tools.nvim": { + "branch": "master", + "repo": "git@github.com:pmizio/typescript-tools.nvim", + "rev": "c43d9580c3ff5999a1eabca849f807ab33787ea7", + "type": "git" + }, "vim-abolish": { "branch": "master", "repo": "git@github.com:tpope/vim-abolish", diff --git a/plugins/lsp.lua b/plugins/lsp.lua index 553e063..372228c 100644 --- a/plugins/lsp.lua +++ b/plugins/lsp.lua @@ -51,7 +51,7 @@ return function() -- Generic lsp configuration -- - local on_init = function(client) + local function on_init(client) client.config.flags = client.config.flags or {} client.config.flags.allow_incremental_sync = true end @@ -60,7 +60,7 @@ return function() -- Use an on_attach function to only map the following keys -- after the language server attaches to the current buffer - local on_attach = function(client, bufnr) + local function on_attach(client, bufnr) -- Enable completion triggered by vim.bo.omnifunc = "v:lua.vim.lsp.omnifunc" @@ -98,7 +98,7 @@ return function() end, { buffer = bufnr, desc = "Format" }, }, - ["l"] = { + ["d"] = { vim.diagnostic.open_float, { buffer = bufnr, desc = "Line diagnostics" }, }, @@ -331,7 +331,7 @@ return function() end end - table.insert(library, require("neodev.config").types()) + -- table.insert(library, require("neodev.config").types()) add "$VIMRUNTIME" @@ -376,34 +376,39 @@ return function() } end - lspconfig.tsserver.setup { + -- lspconfig.tsserver.setup { + -- on_init = on_init, + -- on_attach = on_attach, + -- capabilities = updated_capabilities, + -- settings = { + -- javascript = { + -- inlayHints = { + -- includeInlayEnumMemberValueHints = true, + -- includeInlayFunctionLikeReturnTypeHints = true, + -- includeInlayFunctionParameterTypeHints = true, + -- includeInlayParameterNameHints = "all", -- 'none' | 'literals' | 'all'; + -- includeInlayParameterNameHintsWhenArgumentMatchesName = true, + -- includeInlayPropertyDeclarationTypeHints = true, + -- includeInlayVariableTypeHints = true, + -- }, + -- }, + -- typescript = { + -- inlayHints = { + -- includeInlayEnumMemberValueHints = true, + -- includeInlayFunctionLikeReturnTypeHints = true, + -- includeInlayFunctionParameterTypeHints = true, + -- includeInlayParameterNameHints = "all", -- 'none' | 'literals' | 'all'; + -- includeInlayParameterNameHintsWhenArgumentMatchesName = true, + -- includeInlayPropertyDeclarationTypeHints = true, + -- includeInlayVariableTypeHints = true, + -- }, + -- }, + -- }, + -- } + require("typescript-tools").setup { on_init = on_init, on_attach = on_attach, capabilities = updated_capabilities, - settings = { - javascript = { - inlayHints = { - includeInlayEnumMemberValueHints = true, - includeInlayFunctionLikeReturnTypeHints = true, - includeInlayFunctionParameterTypeHints = true, - includeInlayParameterNameHints = "all", -- 'none' | 'literals' | 'all'; - includeInlayParameterNameHintsWhenArgumentMatchesName = true, - includeInlayPropertyDeclarationTypeHints = true, - includeInlayVariableTypeHints = true, - }, - }, - typescript = { - inlayHints = { - includeInlayEnumMemberValueHints = true, - includeInlayFunctionLikeReturnTypeHints = true, - includeInlayFunctionParameterTypeHints = true, - includeInlayParameterNameHints = "all", -- 'none' | 'literals' | 'all'; - includeInlayParameterNameHintsWhenArgumentMatchesName = true, - includeInlayPropertyDeclarationTypeHints = true, - includeInlayVariableTypeHints = true, - }, - }, - }, } lspconfig.yamlls.setup { diff --git a/plugins/spec.nix b/plugins/spec.nix index 44c0e5c..0da5535 100644 --- a/plugins/spec.nix +++ b/plugins/spec.nix @@ -293,9 +293,6 @@ in rec { clangd_extensions = { src = sources."clangd_extensions.nvim"; }; - neodev = { - src = sources."neodev.nvim"; - }; null-ls = { src = sources."null-ls.nvim"; dependencies = { @@ -328,6 +325,9 @@ in rec { schemastore = { src = sources."SchemaStore.nvim"; }; + typescript-tools = { + src = sources."typescript-tools.nvim"; + }; }; paths = with pkgs; [ alejandra # used by nil for formatting @@ -342,7 +342,6 @@ in rec { marksman nodePackages.graphql-language-service-cli nodePackages.pyright - nodePackages.typescript-language-server nodePackages.vscode-json-languageserver nodePackages.yaml-language-server ruff-lsp