diff options
Diffstat (limited to 'lua/alpha')
| -rw-r--r-- | lua/alpha/lsp/attach.lua | 8 | ||||
| -rw-r--r-- | lua/alpha/lsp/servers.lua | 22 |
2 files changed, 24 insertions, 6 deletions
diff --git a/lua/alpha/lsp/attach.lua b/lua/alpha/lsp/attach.lua index fe71a2a..84212a6 100644 --- a/lua/alpha/lsp/attach.lua +++ b/lua/alpha/lsp/attach.lua @@ -1,6 +1,12 @@ local telescope_mapper = require "alpha.telescope.mappings" -local filetype_attach = setmetatable({}, { +local filetype_attach = setmetatable({ + php = function(client, bufnr) + vim.api.nvim_buf_create_user_command(bufnr, "LspPhpactorReindex", function() + vim.lsp.buf_notify(bufnr, "phpactor/index/reindex", {}) + end, {}) + end, +}, { __index = function() return function() end end, diff --git a/lua/alpha/lsp/servers.lua b/lua/alpha/lsp/servers.lua index d2233a1..ab70468 100644 --- a/lua/alpha/lsp/servers.lua +++ b/lua/alpha/lsp/servers.lua @@ -28,23 +28,23 @@ return { flags = lsp_flags, } end, - ["html"] = function () + ["html"] = function() local config = { on_attach = lsp_attach, flags = lsp_flags, } - if vim.fn.executable("html-languageserver") == 1 then + if vim.fn.executable "html-languageserver" == 1 then config.cmd = { "html-languageserver", "--stdio" } end return config end, - ["jsonls"] = function () + ["jsonls"] = function() local config = { on_attach = lsp_attach, flags = lsp_flags, } - if vim.fn.executable("json-languageserver") == 1 then + if vim.fn.executable "json-languageserver" == 1 then config.cmd = { "json-languageserver", "--stdio" } end @@ -85,8 +85,20 @@ return { filetypes = { "php", "cucumber" }, init_options = { ["language_server_worse_reflection.inlay_hints.enable"] = true, + ["language_server_worse_reflection.inlay_hints.params"] = true, -- ["language_server_worse_reflection.inlay_hints.types"] = true, - -- ["language_server_worse_reflection.inlay_hints.params"] = true, + ["language_server_configuration.auto_config"] = false, + ["code_transform.import_globals"] = true, + ["language_server_phpstan.enabled"] = true, + ["language_server_phpstan.bin"] = "phpstan", + }, + handlers = { + ["textDocument/inlayHint"] = function(err, result, ...) + for _, res in ipairs(result) do + res.label = res.label .. ": " + end + vim.lsp.handlers["textDocument/inlayHint"](err, result, ...) + end, }, } end, |