From dbc8ca87edb1c92b6c4422c206db4415cfa1e1d2 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Thu, 20 Apr 2023 12:02:43 +0100 Subject: Use format --- haskell.vim | 2 +- lsp.lua | 2 +- metals.vim | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/haskell.vim b/haskell.vim index b61a36e..ea9ca26 100644 --- a/haskell.vim +++ b/haskell.vim @@ -1,5 +1,5 @@ " haskell LSP settings " autocmd FileType haskell setlocal omnifunc=v:lua.vim.lsp.omnifunc -autocmd BufWritePre *.hs :lua vim.lsp.buf.formatting_seq_sync() +autocmd BufWritePre *.hs :lua vim.lsp.buf.format() diff --git a/lsp.lua b/lsp.lua index 295fcb3..16a25b8 100644 --- a/lsp.lua +++ b/lsp.lua @@ -93,7 +93,7 @@ vim.diagnostic.config({ virtual_text = false, signs = true }) -- for go -- install gopls with: go install golang.org/x/tools/gopls@latest -vim.cmd([[autocmd BufWritePre *.go :lua vim.lsp.buf.formatting_seq_sync()]]) +vim.cmd([[autocmd BufWritePre *.go :lua vim.lsp.buf.format()]]) -- for trouble require("trouble").setup() diff --git a/metals.vim b/metals.vim index 5203ee2..c9dfae9 100644 --- a/metals.vim +++ b/metals.vim @@ -24,7 +24,7 @@ function! MetalsMapKeys() abort nnoremap gsh lua vim.lsp.buf.signature_help() nnoremap rn lua vim.lsp.buf.rename() nnoremap oi lua require('metals').organize_imports() - nnoremap F lua vim.lsp.buf.formatting() + nnoremap F lua vim.lsp.buf.format() nnoremap ca lua vim.lsp.buf.code_action() nnoremap aw lua vim.diagnostic.setqflist({severity = "W"}) nnoremap a lua vim.diagnostic.setqflist() @@ -45,6 +45,6 @@ augroup end " autocmd FileType scala setlocal omnifunc=v:lua.vim.lsp.omnifunc autocmd FileType scala call MetalsMapKeys() -autocmd BufWritePre *.scala,*.sc,*.sbt :lua vim.lsp.buf.formatting_seq_sync() +autocmd BufWritePre *.scala,*.sc,*.sbt :lua vim.lsp.buf.format() autocmd BufNewFile,BufRead *.sc set filetype=scala -- cgit v1.2.3