diff options
| author | Ariel D'Alessandro <ariel.dalessandro@auto1.com> | 2022-10-17 09:28:34 +0200 |
|---|---|---|
| committer | Ariel D'Alessandro <ariel.dalessandro@auto1.com> | 2022-10-17 09:29:32 +0200 |
| commit | 0971768bdd5a06916dc2a74296fb76bd5b211540 (patch) | |
| tree | 5e657d528d8c467151c46dd11475acbbff386b43 /lua/alpha/php/servers.lua | |
| parent | 7e62950549047548c2744b634d5947da67647881 (diff) | |
| download | nvim-conf-0971768bdd5a06916dc2a74296fb76bd5b211540.tar.gz nvim-conf-0971768bdd5a06916dc2a74296fb76bd5b211540.zip | |
feat: add yaml snippets, use phpactor for internal php lsp action
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, } |