Skip to content

Commit cf72c64

Browse files
fix(sourcekit-lsp): use git as last resort for sourcekit-lsp. (#3192)
* fix(sourcekit-lsp): use git as last resort for sourcekit-lsp * fix: updated documentation for sourcekit-lsp as well
1 parent 74e1480 commit cf72c64

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/lspconfig/server_configurations/sourcekit.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ return {
77
root_dir = function(filename, _)
88
return util.root_pattern 'buildServer.json'(filename)
99
or util.root_pattern('*.xcodeproj', '*.xcworkspace')(filename)
10-
or util.find_git_ancestor(filename)
1110
-- better to keep it at the end, because some modularized apps contain multiple Package.swift files
1211
or util.root_pattern('compile_commands.json', 'Package.swift')(filename)
12+
or util.find_git_ancestor(filename)
1313
end,
1414
},
1515
docs = {
@@ -19,7 +19,7 @@ https://github.com/apple/sourcekit-lsp
1919
Language server for Swift and C/C++/Objective-C.
2020
]],
2121
default_config = {
22-
root_dir = [[root_pattern("buildServer.json", "*.xcodeproj", "*.xcworkspace", ".git", "compile_commands.json", "Package.swift")]],
22+
root_dir = [[root_pattern("buildServer.json", "*.xcodeproj", "*.xcworkspace", "compile_commands.json", "Package.swift", ".git")]],
2323
},
2424
},
2525
}

0 commit comments

Comments
 (0)