From 0971768bdd5a06916dc2a74296fb76bd5b211540 Mon Sep 17 00:00:00 2001 From: Ariel D'Alessandro Date: Mon, 17 Oct 2022 09:28:34 +0200 Subject: feat: add yaml snippets, use phpactor for internal php lsp action --- lua/alpha/php/servers.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lua/alpha/php/servers.lua') 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, } -- cgit v1.2.3