diff --git a/lazy-lock.json b/lazy-lock.json index e3585ef..7b09b73 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -11,40 +11,40 @@ "cmp-rg": { "branch": "master", "commit": "677a7874ee8f1afc648c2e7d63a97bc21a7663c5" }, "cmp-under-comparator": { "branch": "master", "commit": "6857f10272c3cfe930cece2afa2406e1385bfef8" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "conform.nvim": { "branch": "master", "commit": "00f50d4bb17b849bac62cb1b75368333c0a80c96" }, + "conform.nvim": { "branch": "master", "commit": "192a6d2ddace343f1840a8f72efe2315bd392243" }, "diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" }, "dressing.nvim": { "branch": "master", "commit": "6f212262061a2120e42da0d1e87326e8a41c0478" }, "friendly-snippets": { "branch": "main", "commit": "dbd45e9ba76d535e4cba88afa1b7aa43bb765336" }, - "fzf-lua": { "branch": "main", "commit": "91ec17b4fd0d810599f054eef08db967a0457fbf" }, + "fzf-lua": { "branch": "main", "commit": "3b3cc17c7bb91f6bbef7166c0756f89a189c4db4" }, "gh-addressed.nvim": { "branch": "main", "commit": "64c12f0f2a1d28afe53220da5fb86e1adb79be07" }, - "gh-blame.nvim": { "branch": "main", "commit": "80154c9a68f731f18e08a437f16e9579a6cb0a63" }, + "gh-blame.nvim": { "branch": "main", "commit": "1a6e6444a6988135c5e71e73fa207277dceba906" }, "git-conflict.nvim": { "branch": "main", "commit": "4c8e252b87d54d944c1e56bfb477f78b6fdaf661" }, "gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" }, "indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" }, "lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" }, - "lazygit.nvim": { "branch": "main", "commit": "1e08e3f5ac1152339690140e61a4a32b3bdc7de5" }, + "lazygit.nvim": { "branch": "main", "commit": "10a5f30536dc2d4abe36d410d83149272ea457fa" }, "lspkind-nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, "lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" }, "mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" }, "middleclass": { "branch": "master", "commit": "9fab4d5bca67262614960960ca35c4740eb2be2c" }, "mini.align": { "branch": "main", "commit": "f845218c5fea89e49074e48270dc5e1b9511a0f9" }, "mini.surround": { "branch": "main", "commit": "a1b590cc3b676512de507328d6bbab5e43794720" }, - "neo-tree.nvim": { "branch": "main", "commit": "7d3b02073e59ed9ef271795787de76d0de8f5294" }, - "neodev.nvim": { "branch": "main", "commit": "bbe17de89345ce40725e721d347c596dc4a02b32" }, + "neo-tree.nvim": { "branch": "v2.x", "commit": "80dc74d081823649809f78370fa5b204aa9a853a" }, + "neodev.nvim": { "branch": "main", "commit": "f7f249b361e9fb245eea24cbcd9f5502e796c6ea" }, "neovim-project": { "branch": "main", "commit": "e7868b38f402be94e859d479002df1418bc1e954" }, "neovim-session-manager": { "branch": "master", "commit": "d8e1ba3bbcf3fdc6a887bcfbd94c48ae4707b457" }, "noice.nvim": { "branch": "main", "commit": "bf67d70bd7265d075191e7812d8eb42b9791f737" }, "nui.nvim": { "branch": "main", "commit": "c3c7fd618dcb5a89e443a2e1033e7d11fdb0596b" }, - "nvim-autopairs": { "branch": "master", "commit": "90f824d37c0cb079d2764927e73af77faa9ba0ef" }, + "nvim-autopairs": { "branch": "master", "commit": "1efb4f2e754d282762a1413ea0528d9a45143cdd" }, "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, - "nvim-lint": { "branch": "master", "commit": "31be66c27214174a28fc092ffcf4bb3e8f6cfd43" }, - "nvim-lspconfig": { "branch": "master", "commit": "1699ce10c3aaf861cfa0c1303fcd19d2ed93e7ad" }, + "nvim-lint": { "branch": "master", "commit": "6f6d866362c74ec2eb036c32b56fac50b02af669" }, + "nvim-lspconfig": { "branch": "master", "commit": "d5b6d4366dfd7a1071b930defd365e6d0be258de" }, "nvim-navbuddy": { "branch": "master", "commit": "f137a3466a6cd1965cdcc5398daff54e66eebbe5" }, "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, - "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, + "nvim-notify": { "branch": "master", "commit": "80b67b265530632505193553d05127ae7fe09ddd" }, "nvim-origami": { "branch": "main", "commit": "8615cdc4c97aaeb8c7723a49f48e9c44d749034a" }, - "nvim-treesitter": { "branch": "master", "commit": "7eeb26e69cd923f4ebc2e708a6acf40777d4b157" }, + "nvim-treesitter": { "branch": "master", "commit": "c06292fdc641d71d185d2f1a507ad8232b6cf528" }, "nvim-treesitter-refactor": { "branch": "master", "commit": "65ad2eca822dfaec2a3603119ec3cc8826a7859e" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "7f00d94543f1fd37cab2afa2e9a6cd54e1c6b9ef" }, "nvim-ufo": { "branch": "main", "commit": "553d8a9c611caa9f020556d4a26b760698e5b81b" }, @@ -53,9 +53,9 @@ "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, "promise-async": { "branch": "main", "commit": "94f6f03c6c1e2aab551aacdf0c1e597a7269abb6" }, "rustaceanvim": { "branch": "master", "commit": "bc8c4b8f7606d5b7c067cd8369e25c1a7ff77bd0" }, - "schemastore.nvim": { "branch": "main", "commit": "12ff3accf50fe1e59b360b2feb0b1be13d14bd3c" }, + "schemastore.nvim": { "branch": "main", "commit": "0358c7e159e5502361bf3971d89bf5133bcc2893" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, - "telescope-git-submodules.nvim": { "branch": "main", "commit": "e40ca42a97f65c9661a5efce6283d9f73eda729c" }, + "telescope-git-submodules.nvim": { "branch": "main", "commit": "8a4c49f7e6d9ed4234d233398d9cb92b4c92c7fc" }, "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, "todo-comments.nvim": { "branch": "main", "commit": "833d8dd8b07eeda37a09e99460f72a02616935cb" }, "toggleterm.nvim": { "branch": "main", "commit": "193786e0371e3286d3bc9aa0079da1cd41beaa62" }, diff --git a/lua/plugins/illuminate.lua b/lua/plugins/illuminate.lua new file mode 100644 index 0000000..6f1fcf2 --- /dev/null +++ b/lua/plugins/illuminate.lua @@ -0,0 +1,22 @@ +return { + 'RRethy/vim-illuminate', + event = { 'BufReadPost', 'BufNewFile' }, + opts = { + providers = { + 'lsp', + 'treesitter', + }, + filetypes_denylist = { + 'nvimTree', + 'nvim-tree', + 'neo-tree', + 'lazy', + 'telescope', + }, + }, + config = function(_, opts) + require('illuminate').configure(opts) + + vim.cmd('hi link illuminatedWord Visual') + end, +} diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 91e618d..e208b69 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -1,292 +1,217 @@ return { - { - 'RRethy/vim-illuminate', - event = { 'BufReadPost', 'BufNewFile' }, - opts = { - providers = { - 'lsp', - 'treesitter', - }, - filetypes_denylist = { - 'nvimTree', - 'nvim-tree', - 'neo-tree', - 'lazy', - 'telescope', - }, - }, - config = function(_, opts) - require('illuminate').configure(opts) - - vim.cmd('hi link illuminatedWord Visual') - end, + 'neovim/nvim-lspconfig', + event = { 'BufReadPre', 'BufNewFile' }, + dependencies = { + 'b0o/schemastore.nvim', }, - { - 'L3MON4D3/LuaSnip', - dependencies = { - 'rafamadriz/friendly-snippets', - config = function() - require('luasnip.loaders.from_vscode').lazy_load() - end, - }, - opts = { - history = true, - delete_check_events = 'TextChanged', - }, - keys = { - { - '', - function() - return require('luasnip').jumpable(1) and 'luasnip-jump-next' or '' - end, - expr = true, - silent = true, - mode = 'i', - }, - { - '', - function() - require('luasnip').jump(1) - end, - mode = 's', - }, - { - '', - function() - require('luasnip').jump(-1) - end, - mode = { 'i', 's' }, - }, - }, - }, - { 'folke/neodev.nvim', opts = {} }, - { - 'SmiteshP/nvim-navbuddy', - cmd = 'Navbuddy', - keys = { - { 'N', 'Navbuddy', desc = 'nabuddy' }, - }, - dependencies = { - 'SmiteshP/nvim-navic', - 'MunifTanjim/nui.nvim', - }, - opts = { lsp = { auto_attach = true } }, + opts = { + inlay_hints = { enabled = true }, }, - { - 'neovim/nvim-lspconfig', - event = { 'BufReadPre', 'BufNewFile' }, - dependencies = { - 'b0o/schemastore.nvim', - }, - opts = { - inlay_hints = { enabled = true }, - }, - config = function() - local capabilities = require('cmp_nvim_lsp').default_capabilities() - local api, lsp = vim.api, vim.lsp - - -- diagnostics - require('lsp.diagnostics').setup() - - --- on_attach - local on_attach = function(client) - require('illuminate').on_attach(client) - end - - -- required servers - api.nvim_create_autocmd('FileType', { - pattern = 'sh', - callback = function() - lsp.start({ - name = 'bash-language-server', - cmd = { 'bash-language-server', 'start' }, - }) - end, - }) - - api.nvim_create_autocmd({ 'FileType' }, { - pattern = { 'dockerfile' }, - callback = function() - local config = { - name = 'dockerls', - cmd = { 'docker-langserver', '--stdio' }, - root_dir = vim.fs.dirname(vim.fs.find({ 'Dockerfile' }, { upward = true })[1]), - } - - vim.lsp.start(config, { - reuse_client = function(client, conf) - return (client.name == conf.name and (client.config.root_dir == conf.root_dir)) - end, - }) - end, - }) - - api.nvim_create_autocmd('FileType', { - pattern = 'yaml,yml', - callback = function() - lsp.start({ - name = 'docker-compose-langserver', - cmd = { 'docker-compose-langserver', '--stdio' }, - root_dir = vim.fs.dirname(vim.fs.find({ - 'docker-compose.yml', - 'docker-compose.yaml', - 'compose.yml', - 'compose.yaml', + config = function() + local capabilities = require('cmp_nvim_lsp').default_capabilities() + local api, lsp = vim.api, vim.lsp + + -- diagnostics + require('lsp.diagnostics').setup() + + --- on_attach + local on_attach = function(client) + require('illuminate').on_attach(client) + end + + -- required servers + api.nvim_create_autocmd('FileType', { + pattern = 'sh', + callback = function() + lsp.start({ + name = 'bash-language-server', + cmd = { 'bash-language-server', 'start' }, + }) + end, + }) + + api.nvim_create_autocmd({ 'FileType' }, { + pattern = { 'dockerfile' }, + callback = function() + local config = { + name = 'dockerls', + cmd = { 'docker-langserver', '--stdio' }, + root_dir = vim.fs.dirname(vim.fs.find({ 'Dockerfile' }, { upward = true })[1]), + } + + vim.lsp.start(config, { + reuse_client = function(client, conf) + return (client.name == conf.name and (client.config.root_dir == conf.root_dir)) + end, + }) + end, + }) + + api.nvim_create_autocmd('FileType', { + pattern = 'yaml,yml', + callback = function() + lsp.start({ + name = 'docker-compose-langserver', + cmd = { 'docker-compose-langserver', '--stdio' }, + root_dir = vim.fs.dirname(vim.fs.find({ + 'docker-compose.yml', + 'docker-compose.yaml', + 'compose.yml', + 'compose.yaml', -- stylua: ignore "compose.*.yaml", - 'compose.*.yml', - }, { upward = true })[1]), - }) - end, - }) - - api.nvim_create_autocmd('FileType', { - pattern = 'php', - callback = function() - local get_root_dir = function(fname) - local cwd = vim.loop.cwd() - local util = require('lspconfig.util') - local root = util.root_pattern('composer.json', '.git')(fname) - return util.path.iterate_parents(cwd) and cwd or root - end - - local config = { - name = 'intelephense', - cmd = { 'intelephense', '--stdio' }, - root_dir = get_root_dir(), - } - - lsp.start(config, { - reuse_client = function(client, conf) - return (client.name == conf.name and (client.config.root_dir == conf.root_dir)) - end, - }) - end, - }) - - api.nvim_create_autocmd('FileType', { - pattern = 'json,jsonc', - callback = function() - local config = { - name = 'jsonls', - cmd = { 'vscode-json-language-server', '--stdio' }, - root_dir = vim.fs.dirname(vim.fs.find({ '.git' }, { upward = true })[1]), - } - - lsp.start(config, { - reuse_client = function(client, conf) - return (client.name == conf.name and (client.config.root_dir == conf.root_dir)) - end, - }) - end, - }) - - api.nvim_create_autocmd('FileType', { - -- https://github.com/olrtg/emmet-language-server - pattern = 'css,eruby,html,htmldjango,javascriptreact,less,pug,sass,scss,typescriptreact', - callback = function() - local config = { - name = 'emmet-language-server', - cmd = { 'emmet-language-server', '--stdio' }, - root_dir = vim.fs.dirname(vim.fs.find({ '.git' }, { upward = true })[1]), - init_options = { - --- @type string[] - excludeLanguages = {}, - --- @type string[] - extensionsPath = {}, - --- @type table [Emmet Docs](https://docs.emmet.io/customization/preferences/) - preferences = {}, - --- @type boolean Defaults to `true` - showAbbreviationSuggestions = true, - --- @type "always" | "never" Defaults to `"always"` - showExpandedAbbreviation = 'always', - --- @type boolean Defaults to `false` - showSuggestionsAsSnippets = false, - --- @type table [Emmet Docs](https://docs.emmet.io/customization/syntax-profiles/) - syntaxProfiles = {}, - --- @type table [Emmet Docs](https://docs.emmet.io/customization/snippets/#variables) - variables = {}, - }, - } - - lsp.start(config, { - reuse_client = function(client, conf) - return (client.name == conf.name and (client.config.root_dir == conf.root_dir)) - end, - }) - end, - }) - - api.nvim_create_autocmd('FileType', { - -- https://github.com/antonk52/cssmodules-language-server - pattern = 'javascript,javascriptreact,typescript,typescriptreact', - callback = function() - local config = { - name = 'cssmodules-language-server', - cmd = { 'cssmodules-language-server' }, - root_dir = vim.fs.dirname(vim.fs.find({ 'package.json' }, { upward = true })[1]), - init_options = { - --- @type boolean|string `true|false` or `dashes` (defaults to `false`) - camelCase = false, - }, - } - - lsp.start(config, { - reuse_client = function(client, conf) - return (client.name == conf.name and (client.config.root_dir == conf.root_dir)) - end, - }) - end, - }) - - api.nvim_create_autocmd('FileType', { - pattern = { - 'javascript', - 'javascriptreact', - 'javascript.jsx', - 'typescript', - 'typescriptreact', - 'typescript.tsx', - 'vue', - 'svelte', - 'astro', - }, - callback = function() - local get_root_dir = function(fname) - local util = require('lspconfig.util') - local root_file = { - '.eslintrc', - '.eslintrc.js', - '.eslintrc.cjs', - '.eslintrc.yaml', - '.eslintrc.yml', - '.eslintrc.json', - 'eslint.config.js', - } - - root_file = util.insert_package_json(root_file, 'eslintConfig', fname) - return util.root_pattern(unpack(root_file))(fname) - end - - local config = { - name = 'eslint-language-server', - cmd = { 'vscode-eslint-language-server', '--stdio' }, - root_dir = get_root_dir(), + 'compose.*.yml', + }, { upward = true })[1]), + }) + end, + }) + + api.nvim_create_autocmd('FileType', { + pattern = 'php', + callback = function() + local get_root_dir = function(fname) + local cwd = vim.loop.cwd() + local util = require('lspconfig.util') + local root = util.root_pattern('composer.json', '.git')(fname) + return util.path.iterate_parents(cwd) and cwd or root + end + + local config = { + name = 'intelephense', + cmd = { 'intelephense', '--stdio' }, + root_dir = get_root_dir(), + } + + lsp.start(config, { + reuse_client = function(client, conf) + return (client.name == conf.name and (client.config.root_dir == conf.root_dir)) + end, + }) + end, + }) + + api.nvim_create_autocmd('FileType', { + pattern = 'json,jsonc', + callback = function() + local config = { + name = 'jsonls', + cmd = { 'vscode-json-language-server', '--stdio' }, + root_dir = vim.fs.dirname(vim.fs.find({ '.git' }, { upward = true })[1]), + } + + lsp.start(config, { + reuse_client = function(client, conf) + return (client.name == conf.name and (client.config.root_dir == conf.root_dir)) + end, + }) + end, + }) + + api.nvim_create_autocmd('FileType', { + -- https://github.com/olrtg/emmet-language-server + pattern = 'css,eruby,html,htmldjango,javascriptreact,less,pug,sass,scss,typescriptreact', + callback = function() + local config = { + name = 'emmet-language-server', + cmd = { 'emmet-language-server', '--stdio' }, + root_dir = vim.fs.dirname(vim.fs.find({ '.git' }, { upward = true })[1]), + init_options = { + --- @type string[] + excludeLanguages = {}, + --- @type string[] + extensionsPath = {}, + --- @type table [Emmet Docs](https://docs.emmet.io/customization/preferences/) + preferences = {}, + --- @type boolean Defaults to `true` + showAbbreviationSuggestions = true, + --- @type "always" | "never" Defaults to `"always"` + showExpandedAbbreviation = 'always', + --- @type boolean Defaults to `false` + showSuggestionsAsSnippets = false, + --- @type table [Emmet Docs](https://docs.emmet.io/customization/syntax-profiles/) + syntaxProfiles = {}, + --- @type table [Emmet Docs](https://docs.emmet.io/customization/snippets/#variables) + variables = {}, + }, + } + + lsp.start(config, { + reuse_client = function(client, conf) + return (client.name == conf.name and (client.config.root_dir == conf.root_dir)) + end, + }) + end, + }) + + api.nvim_create_autocmd('FileType', { + -- https://github.com/antonk52/cssmodules-language-server + pattern = 'javascript,javascriptreact,typescript,typescriptreact', + callback = function() + local config = { + name = 'cssmodules-language-server', + cmd = { 'cssmodules-language-server' }, + root_dir = vim.fs.dirname(vim.fs.find({ 'package.json' }, { upward = true })[1]), + init_options = { + --- @type boolean|string `true|false` or `dashes` (defaults to `false`) + camelCase = false, + }, + } + + lsp.start(config, { + reuse_client = function(client, conf) + return (client.name == conf.name and (client.config.root_dir == conf.root_dir)) + end, + }) + end, + }) + + api.nvim_create_autocmd('FileType', { + pattern = { + 'javascript', + 'javascriptreact', + 'javascript.jsx', + 'typescript', + 'typescriptreact', + 'typescript.tsx', + 'vue', + 'svelte', + 'astro', + }, + callback = function() + local get_root_dir = function(fname) + local util = require('lspconfig.util') + local root_file = { + '.eslintrc', + '.eslintrc.js', + '.eslintrc.cjs', + '.eslintrc.yaml', + '.eslintrc.yml', + '.eslintrc.json', + 'eslint.config.js', } - lsp.start(config, { - reuse_client = function(client, conf) - return (client.name == conf.name and (client.config.root_dir == conf.root_dir)) - end, - }) - end, - }) - - for _, server in ipairs({ - 'neodev', - }) do - require('lsp.' .. server).setup(on_attach, capabilities) - end - end, - }, + root_file = util.insert_package_json(root_file, 'eslintConfig', fname) + return util.root_pattern(unpack(root_file))(fname) + end + + local config = { + name = 'eslint-language-server', + cmd = { 'vscode-eslint-language-server', '--stdio' }, + root_dir = get_root_dir(), + } + + lsp.start(config, { + reuse_client = function(client, conf) + return (client.name == conf.name and (client.config.root_dir == conf.root_dir)) + end, + }) + end, + }) + + for _, server in ipairs({ + 'neodev', + }) do + require('lsp.' .. server).setup(on_attach, capabilities) + end + end, } diff --git a/lua/plugins/luasnip.lua b/lua/plugins/luasnip.lua new file mode 100644 index 0000000..1bec516 --- /dev/null +++ b/lua/plugins/luasnip.lua @@ -0,0 +1,38 @@ +return { + 'L3MON4D3/LuaSnip', + dependencies = { + 'rafamadriz/friendly-snippets', + config = function() + require('luasnip.loaders.from_vscode').lazy_load() + end, + }, + opts = { + history = true, + delete_check_events = 'TextChanged', + }, + keys = { + { + '', + function() + return require('luasnip').jumpable(1) and 'luasnip-jump-next' or '' + end, + expr = true, + silent = true, + mode = 'i', + }, + { + '', + function() + require('luasnip').jump(1) + end, + mode = 's', + }, + { + '', + function() + require('luasnip').jump(-1) + end, + mode = { 'i', 's' }, + }, + }, +} diff --git a/lua/plugins/navbuddy.lua b/lua/plugins/navbuddy.lua new file mode 100644 index 0000000..e173be7 --- /dev/null +++ b/lua/plugins/navbuddy.lua @@ -0,0 +1,12 @@ +return { + 'SmiteshP/nvim-navbuddy', + cmd = 'Navbuddy', + keys = { + { 'N', 'Navbuddy', desc = 'nabuddy' }, + }, + dependencies = { + 'SmiteshP/nvim-navic', + 'MunifTanjim/nui.nvim', + }, + opts = { lsp = { auto_attach = true } }, +} diff --git a/lua/plugins/neodev.lua b/lua/plugins/neodev.lua new file mode 100644 index 0000000..a8d0b37 --- /dev/null +++ b/lua/plugins/neodev.lua @@ -0,0 +1,4 @@ +return { + 'folke/neodev.nvim', + opts = {}, +} diff --git a/lua/plugins/rustaceanvim.lua b/lua/plugins/rustaceanvim.lua index 07209cd..bd8ef14 100644 --- a/lua/plugins/rustaceanvim.lua +++ b/lua/plugins/rustaceanvim.lua @@ -1,4 +1,10 @@ return { + { + 'nvim-treesitter/nvim-treesitter', + opts = function(_, opts) + vim.list_extend(opts.ensure_installed or {}, { 'rust' }) + end, + }, { 'mrcjkb/rustaceanvim', version = '^3', @@ -35,7 +41,13 @@ return { vim.g.rustaceanvim = vim.tbl_deep_extend('force', {}, opts or {}) end, }, - + { + 'williamboman/mason.nvim', + opts = function(_, opts) + opts.ensure_installed = opts.ensure_installed or {} + vim.list_extend(opts.ensure_installed, { 'rust-analyzer', 'rustfmt' }) + end, + }, { 'neovim/nvim-lspconfig', opts = { diff --git a/lua/plugins/typescript-tools.lua b/lua/plugins/typescript-tools.lua index badc183..48eb4eb 100644 --- a/lua/plugins/typescript-tools.lua +++ b/lua/plugins/typescript-tools.lua @@ -1,24 +1,35 @@ return { - 'pmizio/typescript-tools.nvim', - dependencies = { 'nvim-lua/plenary.nvim', 'neovim/nvim-lspconfig' }, - config = function() - require('typescript-tools').setup({ - settings = { - jsx_close_tag = { enable = true }, - tsserver_plugins = { - '@styled/typescript-styled-plugin', + { + 'nvim-treesitter/nvim-treesitter', + opts = function(_, opts) + vim.list_extend(opts.ensure_installed or {}, { 'typescript', 'jsx', 'javascript', 'jq', 'json' }) + end, + }, + { + 'pmizio/typescript-tools.nvim', + dependencies = { + 'nvim-lua/plenary.nvim', + 'neovim/nvim-lspconfig', + }, + config = function() + require('typescript-tools').setup({ + settings = { + jsx_close_tag = { enable = true }, + tsserver_plugins = { + '@styled/typescript-styled-plugin', + }, + --- https://github.com/microsoft/TypeScript/blob/v5.0.4/src/server/protocol.ts#L3439 + tsserver_file_preferences = { + includeInlayParameterNameHints = 'all', + includeCompletionsForModuleExports = true, + }, + -- https://github.com/microsoft/TypeScript/blob/v5.0.4/src/server/protocol.ts#L3418 + tsserver_format_options = { + allowIncompleteCompletions = false, + allowRenameOfImportPath = true, + }, }, - --- https://github.com/microsoft/TypeScript/blob/v5.0.4/src/server/protocol.ts#L3439 - tsserver_file_preferences = { - includeInlayParameterNameHints = 'all', - includeCompletionsForModuleExports = true, - }, - -- https://github.com/microsoft/TypeScript/blob/v5.0.4/src/server/protocol.ts#L3418 - tsserver_format_options = { - allowIncompleteCompletions = false, - allowRenameOfImportPath = true, - }, - }, - }) - end, + }) + end, + }, }