summaryrefslogtreecommitdiff
path: root/lua/lsp
diff options
context:
space:
mode:
authorChris <[email protected]>2021-03-17 15:48:52 -0400
committerChris <[email protected]>2021-03-17 15:48:52 -0400
commit5f482b6054ee67408ce111a2498bcbb69e4271e1 (patch)
tree6436a35aa9389a9b7d11f604ffa28ff60f624e82 /lua/lsp
parentb29ef8fa58b5214ed835f7711243e0ba492aebce (diff)
lua formatting
Diffstat (limited to 'lua/lsp')
-rw-r--r--lua/lsp/efm-general-ls.lua3
-rw-r--r--lua/lsp/init.lua32
-rw-r--r--lua/lsp/java-ls.lua5
-rw-r--r--lua/lsp/js-ts-ls.lua20
-rw-r--r--lua/lsp/lua-ls.lua17
5 files changed, 52 insertions, 25 deletions
diff --git a/lua/lsp/efm-general-ls.lua b/lua/lsp/efm-general-ls.lua
index fa28dbcf..8b6af006 100644
--- a/lua/lsp/efm-general-ls.lua
+++ b/lua/lsp/efm-general-ls.lua
@@ -6,10 +6,11 @@ require"lspconfig".efm.setup {
languages = {
lua = {
{
- formatCommand = "lua-format -i --no-keep-simple-function-one-line --no-break-after-operator --column-limit=150 --break-after-table-lb",
+ formatCommand = "lua-format -i --no-keep-simple-function-one-line --column-limit=100",
formatStdin = true
}
}
}
}
}
+
diff --git a/lua/lsp/init.lua b/lua/lsp/init.lua
index 89969d54..7ae6bab3 100644
--- a/lua/lsp/init.lua
+++ b/lua/lsp/init.lua
@@ -1,8 +1,24 @@
---TODO figure out why this don't work
-vim.fn.sign_define("LspDiagnosticsSignError", {texthl = "LspDiagnosticsSignError", text = "", numhl = "LspDiagnosticsSignError"})
-vim.fn.sign_define("LspDiagnosticsSignWarning", {texthl = "LspDiagnosticsSignWarning", text = "", numhl = "LspDiagnosticsSignWarning"})
-vim.fn.sign_define("LspDiagnosticsSignInformation", {texthl = "LspDiagnosticsSignInformation", text = "", numhl = "LspDiagnosticsSignInformation"})
-vim.fn.sign_define("LspDiagnosticsSignHint", {texthl = "LspDiagnosticsSignHint", text = "", numhl = "LspDiagnosticsSignHint"})
+-- TODO figure out why this don't work
+vim.fn.sign_define("LspDiagnosticsSignError", {
+ texthl = "LspDiagnosticsSignError",
+ text = "",
+ numhl = "LspDiagnosticsSignError"
+})
+vim.fn.sign_define("LspDiagnosticsSignWarning", {
+ texthl = "LspDiagnosticsSignWarning",
+ text = "",
+ numhl = "LspDiagnosticsSignWarning"
+})
+vim.fn.sign_define("LspDiagnosticsSignInformation", {
+ texthl = "LspDiagnosticsSignInformation",
+ text = "",
+ numhl = "LspDiagnosticsSignInformation"
+})
+vim.fn.sign_define("LspDiagnosticsSignHint", {
+ texthl = "LspDiagnosticsSignHint",
+ text = "",
+ numhl = "LspDiagnosticsSignHint"
+})
vim.cmd('nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>')
vim.cmd('nnoremap <silent> gD <cmd>lua vim.lsp.buf.declaration()<CR>')
@@ -14,9 +30,11 @@ vim.cmd('nnoremap <silent> K :Lspsaga hover_doc<CR>')
vim.cmd('nnoremap <silent> <C-p> :Lspsaga diagnostic_jump_prev<CR>')
vim.cmd('nnoremap <silent> <C-n> :Lspsaga diagnostic_jump_next<CR>')
-- scroll down hover doc or scroll in definition preview
-vim.cmd('nnoremap <silent> <C-f> <cmd>lua require(\'lspsaga.action\').smart_scroll_with_saga(1)<CR>')
+vim.cmd(
+ 'nnoremap <silent> <C-f> <cmd>lua require(\'lspsaga.action\').smart_scroll_with_saga(1)<CR>')
-- scroll up hover doc
-vim.cmd('nnoremap <silent> <C-b> <cmd>lua require(\'lspsaga.action\').smart_scroll_with_saga(-1)<CR>')
+vim.cmd(
+ 'nnoremap <silent> <C-b> <cmd>lua require(\'lspsaga.action\').smart_scroll_with_saga(-1)<CR>')
--[[ " autoformat
autocmd BufWritePre *.js lua vim.lsp.buf.formatting_sync(nil, 100)
diff --git a/lua/lsp/java-ls.lua b/lua/lsp/java-ls.lua
index 72ce5104..31f9744d 100644
--- a/lua/lsp/java-ls.lua
+++ b/lua/lsp/java-ls.lua
@@ -12,4 +12,7 @@ elseif vim.fn.has("unix") == 1 then
else
print("Unsupported system")
end
-require('jdtls').start_or_attach({cmd = {JAVA_LS_EXECUTABLE}, root_dir = require('jdtls.setup').find_root({'gradle.build', 'pom.xml'})})
+require('jdtls').start_or_attach({
+ cmd = {JAVA_LS_EXECUTABLE},
+ root_dir = require('jdtls.setup').find_root({'gradle.build', 'pom.xml'})
+})
diff --git a/lua/lsp/js-ts-ls.lua b/lua/lsp/js-ts-ls.lua
index 59b7bbd5..73033f50 100644
--- a/lua/lsp/js-ts-ls.lua
+++ b/lua/lsp/js-ts-ls.lua
@@ -1,16 +1,14 @@
-- npm install -g typescript typescript-language-server
-- require'snippets'.use_suggested_mappings()
-
-- local capabilities = vim.lsp.protocol.make_client_capabilities()
-- capabilities.textDocument.completion.completionItem.snippetSupport = true;
-local on_attach_common = function(client)
- --print("LSP Initialized")
- -- require'completion'.on_attach(client)
- require'illuminate'.on_attach(client)
-end
-
-require'lspconfig'.tsserver.setup{
- on_attach = function(client)
- on_attach_common(client)
- end,
+-- local on_attach_common = function(client)
+-- print("LSP Initialized")
+-- require'completion'.on_attach(client)
+-- require'illuminate'.on_attach(client)
+-- end
+require'lspconfig'.tsserver.setup {
+ -- on_attach = function(client)
+ -- on_attach_common(client)
+ -- end,
}
diff --git a/lua/lsp/lua-ls.lua b/lua/lsp/lua-ls.lua
index c2bd79c0..ef0e599e 100644
--- a/lua/lsp/lua-ls.lua
+++ b/lua/lsp/lua-ls.lua
@@ -5,11 +5,15 @@ local sumneko_root_path = ""
local sumneko_binary = ""
if vim.fn.has("mac") == 1 then
- sumneko_root_path = "/Users/" .. USER .. "/.config/nvim/ls/lua-language-server"
- sumneko_binary = "/Users/" .. USER .. "/.config/nvim/ls/lua-language-server/bin/macOS/lua-language-server"
+ sumneko_root_path = "/Users/" .. USER ..
+ "/.config/nvim/ls/lua-language-server"
+ sumneko_binary = "/Users/" .. USER ..
+ "/.config/nvim/ls/lua-language-server/bin/macOS/lua-language-server"
elseif vim.fn.has("unix") == 1 then
- sumneko_root_path = "/home/" .. USER .. "/.config/nvim/ls/lua-language-server"
- sumneko_binary = "/home/" .. USER .. "/.config/nvim/ls/lua-language-server/bin/Linux/lua-language-server"
+ sumneko_root_path = "/home/" .. USER ..
+ "/.config/nvim/ls/lua-language-server"
+ sumneko_binary = "/home/" .. USER ..
+ "/.config/nvim/ls/lua-language-server/bin/Linux/lua-language-server"
else
print("Unsupported system for sumneko")
end
@@ -30,7 +34,10 @@ require'lspconfig'.sumneko_lua.setup {
},
workspace = {
-- Make the server aware of Neovim runtime files
- library = {[vim.fn.expand('$VIMRUNTIME/lua')] = true, [vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true}
+ library = {
+ [vim.fn.expand('$VIMRUNTIME/lua')] = true,
+ [vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true
+ }
}
}
}