aboutsummaryrefslogtreecommitdiffstats
path: root/lsp/smarty_ls.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lsp/smarty_ls.lua')
-rw-r--r--lsp/smarty_ls.lua6
1 files changed, 2 insertions, 4 deletions
diff --git a/lsp/smarty_ls.lua b/lsp/smarty_ls.lua
index a01cae4c..5527c046 100644
--- a/lsp/smarty_ls.lua
+++ b/lsp/smarty_ls.lua
@@ -10,18 +10,16 @@
--- npm i -g vscode-smarty-langserver-extracted
--- ```
-local util = require 'lspconfig.util'
-
return {
cmd = { 'smarty-language-server', '--stdio' },
filetypes = { 'smarty' },
root_dir = function(bufnr, on_dir)
local fname = vim.api.nvim_buf_get_name(bufnr)
local cwd = assert(vim.uv.cwd())
- local root = util.root_pattern('composer.json', '.git')(fname)
+ local root = vim.fs.root(fname, { 'composer.json', '.git' })
-- prefer cwd if root is a descendant
- on_dir(vim.fs.relpath(cwd, root) and cwd or root)
+ on_dir(root and vim.fs.relpath(cwd, root) and cwd)
end,
settings = {
smarty = {