Fix perlpls (update config to change deprecated settings)

This commit is contained in:
Jonas Ryssel 2022-12-20 09:37:23 +01:00
parent 5205b3f44c
commit 08bf84229b

View File

@ -1041,6 +1041,7 @@ if $USER =~ "^jry$" && $HOSTNAME =~ "gnu"
lua <<EOF
local jix_lsp = require 'jix.lsp'
local util = require 'lspconfig.util'
-- Mappings.
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
@ -1067,9 +1068,9 @@ lua <<EOF
-- Show signature for function under cursor (virker i skrivende stund ikke med subroutine signatures)
--vim.keymap.set('n', '<C-f>', vim.lsp.buf.signature_help, bufopts)
-- Format file with perltidy
vim.keymap.set('n', '<leader>f', vim.lsp.buf.formatting, bufopts)
vim.keymap.set('n', '<leader>f', function() vim.lsp.buf.format { async = true } end, bufopts)
-- Format visual selection with perltidy
vim.keymap.set('v', '<leader>f', vim.lsp.buf.range_formatting, bufopts)
vim.keymap.set('v', '<leader>f', function() vim.lsp.buf.format { async = true } end, bufopts)
-- Slå Neomake fra i buffer for at undgå dobbeltarbejde
vim.api.nvim_command('silent NeomakeDisableBuffer')
@ -1077,6 +1078,8 @@ lua <<EOF
local config = {
cmd = { 'jix-shell', 'pls' },
filetypes = { 'perl' },
root_dir = util.find_git_ancestor,
settings = {
-- Se https://metacpan.org/pod/PLS#OPTIONS for mulige options
perl = {
@ -1090,6 +1093,7 @@ lua <<EOF
perltidyrc = '~/jobxx/perltidyrc',
},
},
single_file_support = true,
on_attach = on_attach,
handlers = jix_lsp.handlers,
}