More changes

This commit is contained in:
2025-11-09 23:03:51 +00:00
parent 529cfa79c8
commit a21a1a3386
4 changed files with 76 additions and 32 deletions

View File

@@ -4,7 +4,15 @@ local t = ls.text_node
local i = ls.insert_node
local f = ls.function_node
local function get_psr4_root()
local function get_psr4_root(path)
-- local dir = vim.fs.dirname(path)
-- while dir ~= '/' and dir ~= nil do
-- local composer_json_path = dir .. '/composer.json'
-- if vim.fn.filereadable(composer_json_path) == 1 then
-- break
-- end
-- dir = vim.fs.dirname(dir)
-- end
local handle = io.popen [[php -r "echo array_keys(json_decode(file_get_contents('composer.json'), true)['autoload']['psr-4'])[0];"]]
local ns_root = handle and handle:read '*a' or ''
if handle then