Add LSP basics (PHP)

Add for PHP via existing phpactor as server.
Use new signature plugin for proper none irritating inline help during
function calls.

TODO: Get rid of preview window showing up …
This commit is contained in:
Daniel Siepmann 2022-03-16 14:46:12 +01:00
parent a842f100b0
commit 40cef5b623
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
3 changed files with 26 additions and 3 deletions

View file

@ -314,6 +314,27 @@ in {
'';
}
# LSP (=Language Server Protocol)
{
plugin = nvim-lspconfig;
type = "lua";
config = ''
require'lspconfig'.phpactor.setup({
cmd = {
'${phpactor}/bin/phpactor',
'language-server',
},
})
'';
}
{
plugin = lsp_signature-nvim;
type = "lua";
config = pkgs.lib.fileContents ./neovim/plugins/lsp-signature.lua;
}
# More related to testing, linting, …
{

View file

@ -7,8 +7,6 @@ syn spell toplevel
set nospell
if exists('&omnifunc') && exists('g:loaded_phpactor')
setlocal omnifunc=phpactor#Complete
" Would enable autocompletion via lsp
" setlocal omnifunc=v:lua.vim.lsp.omnifunc
setlocal omnifunc=v:lua.vim.lsp.omnifunc
endif

View file

@ -0,0 +1,4 @@
require "lsp_signature".setup({
-- For now, as this would hide parts of autocomplete
floating_window = false,
})