From fc7c15fd84a956ace3cc59716f4a67ea84596e6c Mon Sep 17 00:00:00 2001 From: Rokas Puzonas Date: Mon, 1 Nov 2021 16:13:43 +0200 Subject: [PATCH] fix: update lspconfig --- lua/config/cmp.lua | 2 +- lua/config/lspconfig.lua | 22 ++++++++++++++++++---- lua/config/lspinstaller.lua | 7 +++++++ 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/lua/config/cmp.lua b/lua/config/cmp.lua index c77aa8e..550fc55 100644 --- a/lua/config/cmp.lua +++ b/lua/config/cmp.lua @@ -19,7 +19,7 @@ cmp.setup{ [''] = cmp.mapping.complete(), [''] = cmp.mapping.close(), [''] = cmp.mapping.confirm({ - behavior = cmp.ConfirmBehavior.Replace, + behavior = cmp.ConfirmBehavior.Insert, select = true, }) }, diff --git a/lua/config/lspconfig.lua b/lua/config/lspconfig.lua index e68e007..d02e9e2 100644 --- a/lua/config/lspconfig.lua +++ b/lua/config/lspconfig.lua @@ -16,9 +16,23 @@ M.server_settings = { { formatCommand = "lua-format -i", formatStdin = true } } } - } + }, - -- sumneko_lua = { + -- "Lua.runtime.version": "LuaJIT", + -- "Lua.workspace.library": ["${3rd}/love2d/library"], + -- "Lua.workspace.checkThirdParty": false, + -- "Lua.diagnostics.disable": ["undefined-field"] + sumneko_lua = { + Lua = { + -- runtime = { + -- version = "LuaJIT" + -- }, + -- workspace = { + -- checkThirdParty = false, + -- library = {"${3rd}/love2d/library"} + -- } + + -- } -- Lua = { -- runtime = { -- -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) @@ -35,8 +49,8 @@ M.server_settings = { -- library = vim.api.nvim_get_runtime_file("", true) -- }, -- telemetry = { enable = false } - -- } - -- } + } + } } -- Apply general settings for each server diff --git a/lua/config/lspinstaller.lua b/lua/config/lspinstaller.lua index 3a5c00f..827f302 100644 --- a/lua/config/lspinstaller.lua +++ b/lua/config/lspinstaller.lua @@ -15,7 +15,14 @@ end local capabilities = lspconfig_config.get_capabilities() lsp_instller.on_server_ready(function(server) + + -- print(server.name) + -- print(vim.inspect(lspconfig_config.get_server_settings(server.name))) + server:setup{ + root_dir = function() + return vim.fn.getcwd() + end, init_options = lspconfig_config.get_server_init_options(server.name), on_attach = lspconfig_config.on_attach, on_init = lspconfig_config.on_init,