From b7ef29a8886a57aadb787807a7c6cf74c1f0ed3a Mon Sep 17 00:00:00 2001 From: anand Date: Wed, 17 Dec 2025 15:57:55 +0530 Subject: Nixos --- nvim/lsp/smarty_ls.lua | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 nvim/lsp/smarty_ls.lua (limited to 'nvim/lsp/smarty_ls.lua') diff --git a/nvim/lsp/smarty_ls.lua b/nvim/lsp/smarty_ls.lua new file mode 100755 index 0000000..5527c04 --- /dev/null +++ b/nvim/lsp/smarty_ls.lua @@ -0,0 +1,35 @@ +---@brief +--- +--- https://github.com/landeaux/vscode-smarty-langserver-extracted +--- +--- Language server for Smarty. +--- +--- `smarty-language-server` can be installed via `npm`: +--- +--- ```sh +--- npm i -g vscode-smarty-langserver-extracted +--- ``` + +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 = vim.fs.root(fname, { 'composer.json', '.git' }) + + -- prefer cwd if root is a descendant + on_dir(root and vim.fs.relpath(cwd, root) and cwd) + end, + settings = { + smarty = { + pluginDirs = {}, + }, + css = { + validate = true, + }, + }, + init_options = { + storageDir = nil, + }, +} -- cgit v1.2.3