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/codeqlls.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lua/lspconfig/codeqlls.lua') diff --git a/lua/lspconfig/codeqlls.lua b/lua/lspconfig/codeqlls.lua index 5bb13a48..e80070e7 100644 --- a/lua/lspconfig/codeqlls.lua +++ b/lua/lspconfig/codeqlls.lua @@ -3,15 +3,12 @@ local util = require 'lspconfig/util' local server_name = 'codeqlls' -local root_pattern = util.root_pattern 'qlpack.yml' - configs[server_name] = { default_config = { cmd = { 'codeql', 'execute', 'language-server', '--check-errors', 'ON_CHANGE', '-q' }, filetypes = { 'ql' }, - root_dir = function(fname) - return root_pattern(fname) or util.path.dirname(fname) - end, + root_dir = util.root_pattern 'qlpack.yml', + single_file_support = true, log_level = vim.lsp.protocol.MessageType.Warning, before_init = function(initialize_params) initialize_params['workspaceFolders'] = {