diff --git a/after/lsp/basedpyright.lua b/after/lsp/basedpyright.lua new file mode 100644 index 0000000..5d369c0 --- /dev/null +++ b/after/lsp/basedpyright.lua @@ -0,0 +1,7 @@ +return { + settings = { + basedpyright = { + typeCheckingMode = 'standard', + }, + }, +} diff --git a/after/lsp/clangd.lua b/after/lsp/clangd.lua new file mode 100644 index 0000000..36c7b6e --- /dev/null +++ b/after/lsp/clangd.lua @@ -0,0 +1,21 @@ +return { + cmd = { + 'clangd', + '--compile-commands-dir=build_nvim', + '--query-driver', + '/opt/cortex-a78-2022.08-gcc12.1-linux5.15/bin/aarch64-linux-gnu-g*', + '--clang-tidy', + '--background-index', + '--use-dirty-headers', + '--completion-style=detailed', + }, + root_markers = { + '.clangd', + '.clang-tidy', + '.clang-format', + 'compile_flags.txt', + 'configure.ac', + '.git', + 'build_nvim', + }, +} diff --git a/after/lsp/lua_ls.lua b/after/lsp/lua_ls.lua new file mode 100644 index 0000000..1769114 --- /dev/null +++ b/after/lsp/lua_ls.lua @@ -0,0 +1,22 @@ +return { + settings = { + Lua = { + workspace = { + checkThirdParty = false, + }, + completion = { + callSnippet = 'Replace', + }, + -- Do not send telemetry data containing a randomized but unique identifier + telemetry = { + enable = false, + }, + diagnostics = { + disable = { 'missing-fields' }, + }, + format = { + enable = false, + }, + }, + }, +} diff --git a/after/lsp/yamlls.lua b/after/lsp/yamlls.lua new file mode 100644 index 0000000..46dd36b --- /dev/null +++ b/after/lsp/yamlls.lua @@ -0,0 +1,7 @@ +return { + settings = { + yaml = { + validate = true, + }, + }, +} diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 2004553..57e226b 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -41,74 +41,21 @@ return { lazy = false, config = function() local servers = { - basedpyright = { - settings = { - basedpyright = { - typeCheckingMode = 'standard', - }, - }, - }, - ruff = {}, - clangd = { - cmd = { - 'clangd', - '--compile-commands-dir=build_nvim', - '--query-driver', - '/opt/cortex-a78-2022.08-gcc12.1-linux5.15/bin/aarch64-linux-gnu-g*', - '--clang-tidy', - '--background-index', - '--use-dirty-headers', - '--completion-style=detailed', - }, - root_markers = { - '.clangd', - '.clang-tidy', - '.clang-format', - 'compile_flags.txt', - 'configure.ac', - '.git', - 'build_nvim', - }, - }, - lua_ls = { - settings = { - Lua = { - workspace = { - checkThirdParty = false, - }, - completion = { - callSnippet = 'Replace', - }, - -- Do not send telemetry data containing a randomized but unique identifier - telemetry = { - enable = false, - }, - diagnostics = { - disable = { 'missing-fields' }, - }, - format = { - enable = false, - }, - }, - }, - }, - jsonls = {}, - dockerls = {}, - yamlls = { - settings = { - yaml = { - validate = true, - }, - }, - }, - neocmake = {}, - markdown_oxide = {}, - taplo = {}, + 'basedpyright', + 'ruff', + 'clangd', + 'lua_ls', + 'jsonls', + 'dockerls', + 'yamlls', + 'neocmake', + 'markdown_oxide', + 'taplo', } require('mason').setup() require('mason-lspconfig').setup({ - ensure_installed = vim.tbl_keys(servers or {}), + ensure_installed = servers, }) local capabilities = vim.lsp.protocol.make_client_capabilities() @@ -117,10 +64,7 @@ return { capabilities = capabilities, }) - for server, settings in pairs(servers) do - vim.lsp.config(server, settings) - vim.lsp.enable(server) - end + vim.lsp.enable(servers) local lsp_group = vim.api.nvim_create_augroup('UserLspAttach', { clear = true }) vim.api.nvim_create_autocmd('LspAttach', {