From 0d1ce78d231773046320caa45fe1a18dfa366761 Mon Sep 17 00:00:00 2001 From: Michael Lingelbach Date: Thu, 11 Nov 2021 01:00:24 -0800 Subject: feat: add single file mode (#1385) * This adds a "single file mode" option for each language server * Currently, if a root is not detected, a new language server is started for each file opened. * Root directory is set to `nil` in start_client. Some servers will refuse to start, or otherwise panic. This is opt-in per server. * Some servers, such as rust-analyzer, explicitly have a "single file mode", we will not support that until it is officially part of the LSP specification Co-authored-by: Peter Lithammer --- lua/lspconfig/powershell_es.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lua/lspconfig/powershell_es.lua') diff --git a/lua/lspconfig/powershell_es.lua b/lua/lspconfig/powershell_es.lua index 528b8cf3..e2fd86ef 100644 --- a/lua/lspconfig/powershell_es.lua +++ b/lua/lspconfig/powershell_es.lua @@ -20,9 +20,8 @@ configs[server_name] = { new_config.cmd = make_cmd(bundle_path) end, filetypes = { 'ps1' }, - root_dir = function(fname) - return util.find_git_ancestor(fname) or vim.fn.getcwd() - end, + root_dir = util.find_git_ancestor, + single_file_mode = true, }, docs = { description = [[ -- cgit v1.2.3-70-g09d2