From cd51acc1e21d3e71c9a6efb0faf4ff05eee06bf4 Mon Sep 17 00:00:00 2001 From: sharpchen <77432836+sharpchen@users.noreply.github.com> Date: Sun, 5 Jan 2025 14:47:34 +0000 Subject: fix(powershell_es): root pattern #3543 --- lua/lspconfig/configs/powershell_es.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lua') diff --git a/lua/lspconfig/configs/powershell_es.lua b/lua/lspconfig/configs/powershell_es.lua index fdc7ba33..2004d334 100644 --- a/lua/lspconfig/configs/powershell_es.lua +++ b/lua/lspconfig/configs/powershell_es.lua @@ -1,4 +1,5 @@ local temp_path = vim.fn.stdpath 'cache' +local util = require 'lspconfig.util' local function make_cmd(new_config) if new_config.bundle_path ~= nil then @@ -20,9 +21,7 @@ return { end, filetypes = { 'ps1' }, - root_dir = function(fname) - return vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1]) - end, + root_dir = util.root_pattern('PSScriptAnalyzerSettings.psd1', '.git'), single_file_support = true, }, docs = { -- cgit v1.2.3-70-g09d2