diff options
Diffstat (limited to 'lua/alpha/php/servers.lua')
| -rw-r--r-- | lua/alpha/php/servers.lua | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lua/alpha/php/servers.lua b/lua/alpha/php/servers.lua index 78c99a8..caab4a8 100644 --- a/lua/alpha/php/servers.lua +++ b/lua/alpha/php/servers.lua @@ -1,5 +1,10 @@ local phpactor = {} +-- TODO possible improvement look how it works underline +-- use the client directly to call, no need for the buffer +-- to find a class. +-- vim.lsp.start() should return the client + function phpactor.findclass(buffer, fqn, callback) local class_parts = vim.split(fqn, "\\") local class = class_parts[#class_parts] @@ -23,6 +28,18 @@ function phpactor.findclass(buffer, fqn, callback) end) end +-- getting the config I can re use the client +-- the next thing is to make the request with the client +local config = require("lspconfig").phpactor +config.root_dir = vim.fn.getcwd() +local client_id = vim.lsp.start( + config +); + +local client = vim.lsp.get_client_by_id(client_id) +P(client) +-- use client.request or request_sync +-- look for the direct of the symbol return { phpactor = phpactor, } |