Skip to content

Commit f4229d9

Browse files
committed
feat(phan): do not use lspconfig.util
1 parent 823e170 commit f4229d9

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

lsp/phan.lua

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
---
55
--- Installation: https://github.com/phan/phan#getting-started
66

7-
local util = require 'lspconfig.util'
8-
97
local cmd = {
108
'phan',
119
'-m',
@@ -23,9 +21,8 @@ return {
2321
cmd = cmd,
2422
filetypes = { 'php' },
2523
root_dir = function(bufnr, on_dir)
26-
local fname = vim.api.nvim_buf_get_name(bufnr)
2724
local cwd = assert(vim.uv.cwd())
28-
local root = util.root_pattern('composer.json', '.git')(fname)
25+
local root = vim.fs.root(bufnr, { 'composer.json', '.git' }) or cwd
2926

3027
-- prefer cwd if root is a descendant
3128
on_dir(vim.fs.relpath(cwd, root) and cwd or root)

0 commit comments

Comments
 (0)