Skip to content

Commit

Permalink
Remove usage of deprecated method.
Browse files Browse the repository at this point in the history
  • Loading branch information
avietrov committed Nov 19, 2022
1 parent 9465a8b commit 2ded93b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 26 deletions.
21 changes: 21 additions & 0 deletions nvim/lua/user/lsp/configs.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
local lsp_installer = require("nvim-lsp-installer")
local lsp_config = require("lspconfig")

local servers = { "sumneko_lua" }

lsp_installer.setup {
ensure_installed = servers
}


for _, server in pairs(servers) do
local opts = {
on_attach = require("user.lsp.handlers").on_attach,
capabilities = require("user.lsp.handlers").capabilities,
}
local has_custom_opts, server_custom_opts = pcall(require, "user.lsp.settings." .. server)
if has_custom_opts then
opts = vim.tbl_deep_extend("force", server_custom_opts, opts)
end
lsp_config[server].setup(opts)
end
3 changes: 2 additions & 1 deletion nvim/lua/user/lsp/init.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require "lspconfig"
require "user.lsp.lsp-installer"

require "user.lsp.configs"
require "user.lsp.null-ls"
25 changes: 0 additions & 25 deletions nvim/lua/user/lsp/lsp-installer.lua

This file was deleted.

0 comments on commit 2ded93b

Please sign in to comment.