We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
lspconfig.util
1 parent 8973102 commit ac794faCopy full SHA for ac794fa
1 file changed
lsp/smarty_ls.lua
@@ -10,15 +10,12 @@
10
--- npm i -g vscode-smarty-langserver-extracted
11
--- ```
12
13
-local util = require 'lspconfig.util'
14
-
15
return {
16
cmd = { 'smarty-language-server', '--stdio' },
17
filetypes = { 'smarty' },
18
root_dir = function(bufnr, on_dir)
19
- local fname = vim.api.nvim_buf_get_name(bufnr)
20
local cwd = assert(vim.uv.cwd())
21
- local root = util.root_pattern('composer.json', '.git')(fname)
+ local root = vim.fs.root(bufnr, { 'composer.json', '.git' }) or cwd
22
23
-- prefer cwd if root is a descendant
24
on_dir(vim.fs.relpath(cwd, root) and cwd or root)
0 commit comments