From b84a1f67264a9393a0cea169fcc2268dcf650700 Mon Sep 17 00:00:00 2001 From: Harley Laue Date: Sat, 30 Dec 2023 18:03:33 -0800 Subject: fix(ols): remove single_file_support (#2952) * fix(ols): remove single_file_support It doesn't seem like ols really has support for single_file_support. The ols application crashes with the following message: "ols/src/server/requests.odin(1494:28) Index 0 is out of range 0..<0\n" This happens on workspace/didChangeConfiguration when settings are provided in the users' ols setup. To work around this, essentially turning off single_file_support & adding *.odin as a way to detect a root_dir. This isn't very common but at least one other language server uses this method, qml_ls. However, without this, the ols doesn't really work out of the box for projects that lack a .git directory or ols.json file. * fix(ols): remove single_file_support that defaults to false --- lua/lspconfig/server_configurations/ols.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lua') diff --git a/lua/lspconfig/server_configurations/ols.lua b/lua/lspconfig/server_configurations/ols.lua index 65dd085c..6b890f60 100644 --- a/lua/lspconfig/server_configurations/ols.lua +++ b/lua/lspconfig/server_configurations/ols.lua @@ -4,8 +4,7 @@ return { default_config = { cmd = { 'ols' }, filetypes = { 'odin' }, - root_dir = util.root_pattern('ols.json', '.git'), - single_file_support = true, + root_dir = util.root_pattern('ols.json', '.git', '*.odin'), }, docs = { description = [[ @@ -14,7 +13,7 @@ return { `Odin Language Server`. ]], default_config = { - root_dir = [[util.root_pattern("ols.json", ".git")]], + root_dir = [[util.root_pattern("ols.json", ".git", "*.odin")]], }, }, } -- cgit v1.3