From c02275af70a112194c85c378332a7de859faeec8 Mon Sep 17 00:00:00 2001 From: Gonzalo Date: Tue, 4 Jun 2024 14:56:46 -0500 Subject: [PATCH 1/2] fix(sourcekit-lsp): use git as last resort for sourcekit-lsp --- lua/lspconfig/server_configurations/sourcekit.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lspconfig/server_configurations/sourcekit.lua b/lua/lspconfig/server_configurations/sourcekit.lua index f5ce4130a2..39597fdcd8 100644 --- a/lua/lspconfig/server_configurations/sourcekit.lua +++ b/lua/lspconfig/server_configurations/sourcekit.lua @@ -7,9 +7,9 @@ return { root_dir = function(filename, _) return util.root_pattern 'buildServer.json'(filename) or util.root_pattern('*.xcodeproj', '*.xcworkspace')(filename) - or util.find_git_ancestor(filename) -- better to keep it at the end, because some modularized apps contain multiple Package.swift files or util.root_pattern('compile_commands.json', 'Package.swift')(filename) + or util.find_git_ancestor(filename) end, }, docs = { From ed96681fa34f760f516eb9a66d950d9471e503ce Mon Sep 17 00:00:00 2001 From: Gonzalo Date: Tue, 4 Jun 2024 15:00:41 -0500 Subject: [PATCH 2/2] fix: updated documentation for sourcekit-lsp as well --- lua/lspconfig/server_configurations/sourcekit.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lspconfig/server_configurations/sourcekit.lua b/lua/lspconfig/server_configurations/sourcekit.lua index 39597fdcd8..a906f08377 100644 --- a/lua/lspconfig/server_configurations/sourcekit.lua +++ b/lua/lspconfig/server_configurations/sourcekit.lua @@ -19,7 +19,7 @@ https://github.com/apple/sourcekit-lsp Language server for Swift and C/C++/Objective-C. ]], default_config = { - root_dir = [[root_pattern("buildServer.json", "*.xcodeproj", "*.xcworkspace", ".git", "compile_commands.json", "Package.swift")]], + root_dir = [[root_pattern("buildServer.json", "*.xcodeproj", "*.xcworkspace", "compile_commands.json", "Package.swift", ".git")]], }, }, }