summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/user/plugins/lspconfig.lua
diff options
context:
space:
mode:
authoryuzu-eva <stevenhu@web.de>2022-05-28 02:00:27 +0200
committeryuzu-eva <stevenhu@web.de>2022-05-28 02:00:27 +0200
commita27de406e272dae5b7389d62018517f1bda3f31b (patch)
treeed6997c99e10ac98b34e9352f62558e1981117f5 /.config/nvim/lua/user/plugins/lspconfig.lua
parent5f95b753445c0d15185e3dc409802ac5d382fb45 (diff)
added solargraph to lspconfig
Diffstat (limited to '.config/nvim/lua/user/plugins/lspconfig.lua')
-rw-r--r--.config/nvim/lua/user/plugins/lspconfig.lua70
1 files changed, 41 insertions, 29 deletions
diff --git a/.config/nvim/lua/user/plugins/lspconfig.lua b/.config/nvim/lua/user/plugins/lspconfig.lua
index 2eaa957..3d4c9e3 100644
--- a/.config/nvim/lua/user/plugins/lspconfig.lua
+++ b/.config/nvim/lua/user/plugins/lspconfig.lua
@@ -8,11 +8,11 @@ vim.diagnostic.config {
source = true,
focus = false,
format = function(diagnostic)
- if diagnostic.user_data ~= nil and diagnostic.user_data.lsp.code ~= nil then
- return string.format("%s: %s", diagnostic.user_data.lsp.code, diagnostic.message)
- end
- return diagnostic.message
- end,
+ if diagnostic.user_data ~= nil and diagnostic.user_data.lsp.code ~= nil then
+ return string.format("%s: %s", diagnostic.user_data.lsp.code, diagnostic.message)
+ end
+ return diagnostic.message
+ end,
}
}
@@ -46,7 +46,7 @@ end
-require'lspconfig'.eslint.setup{
+require 'lspconfig'.eslint.setup {
on_attach = on_attach,
flags = {
debounce_text_changes = 150,
@@ -56,7 +56,7 @@ require'lspconfig'.eslint.setup{
},
}
-require'lspconfig'.tsserver.setup{
+require 'lspconfig'.tsserver.setup {
on_attach = on_attach,
flags = {
debounce_text_changes = 150,
@@ -66,33 +66,46 @@ require'lspconfig'.tsserver.setup{
local runtime_path = vim.split(package.path, ';')
table.insert(runtime_path, "lua/?.lua")
table.insert(runtime_path, "lua/?/init.lua")
-
-require'lspconfig'.sumneko_lua.setup {
+require 'lspconfig'.sumneko_lua.setup {
on_attach = on_attach,
flags = {
debounce_text_changes = 150,
},
- cmd = { "/home/cafebabe/repos/lua-language-server/bin/lua-language-server", "-E", "/home/cafebabe/repos/lua-language-server/bin/main.lua"};
+ cmd = { "/home/cafebabe/repos/lua-language-server/bin/lua-language-server", "-E", "/home/cafebabe/repos/lua-language-server/bin/main.lua" };
settings = {
Lua = {
- runtime = {
- -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
- version = 'LuaJIT',
- -- Setup your lua path
- path = runtime_path,
- },
- diagnostics = {
- -- Get the language server to recognize the `vim` global
- globals = {'vim'},
- },
- workspace = {
- -- Make the server aware of Neovim runtime files
- library = vim.api.nvim_get_runtime_file("", true),
- },
- -- Do not send telemetry data containing a randomized but unique identifier
- telemetry = {
- enable = false,
+ runtime = {
+ -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
+ version = 'LuaJIT',
+ -- Setup your lua path
+ path = runtime_path,
+ },
+ diagnostics = {
+ -- Get the language server to recognize the `vim` global
+ globals = { 'vim', 'use' },
+ },
+ workspace = {
+ -- Make the server aware of Neovim runtime files
+ library = vim.api.nvim_get_runtime_file("", true),
+ },
+ -- Do not send telemetry data containing a randomized but unique identifier
+ telemetry = {
+ enable = false,
+ },
},
+ },
+}
+
+require 'lspconfig'.solargraph.setup {
+ on_attach = on_attach,
+ flags = {
+ debounce_text_changes = 150,
+ },
+ cmd = { "solargraph", "stdio" },
+ filetypes = { "ruby" },
+ settings = {
+ solargraph = {
+ diagnostics = true,
},
},
}
@@ -102,10 +115,9 @@ vim.notify = function(msg, log_level, _)
if msg:match 'exit code' then
return
end
- if log_level == vim.log.levels.ERROR then
+ if log_level == vim.log.levels.ERROR then
vim.api.nvim_err_writeln(msg)
else
vim.api.nvim_echo({ { msg } }, true, {})
end
end
-