Skip to content

Commit 8c4f1ad

Browse files
committed
Log when absolute compilation DB search paths are skipped
Absolute search paths were being ignored without logging, which makes it somewhat difficult to diagnose. Log when they're skipped. Also remove a duplicate options merging block - both `createWorkspaceWithInferredBuildServer` and `findImplicitWorkspace` (the only callers of `createWorkspace`) already merge in the workspace options.
1 parent 3096e53 commit 8c4f1ad

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

Sources/BuildServerIntegration/DetermineBuildServer.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ private func searchForCompilationDatabaseConfig(
2626
options: SourceKitLSPOptions
2727
) -> BuildServerSpec? {
2828
let searchPaths =
29-
(options.compilationDatabaseOrDefault.searchPaths ?? []).compactMap {
30-
try? RelativePath(validating: $0)
29+
(options.compilationDatabaseOrDefault.searchPaths ?? []).compactMap { searchPath in
30+
orLog("Compilation DB search path") {
31+
try RelativePath(validating: searchPath)
32+
}
3133
} + [
3234
// These default search paths match the behavior of `clangd`
3335
try! RelativePath(validating: "."),

Sources/SourceKitLSP/SourceKitLSPServer.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -912,13 +912,7 @@ extension SourceKitLSPServer {
912912
logger.log("Cannot open workspace before server is initialized")
913913
throw NoCapabilityRegistryError()
914914
}
915-
let options = SourceKitLSPOptions.merging(
916-
base: self.options,
917-
override: SourceKitLSPOptions(
918-
path: workspaceFolder.fileURL?
919-
.appending(components: ".sourcekit-lsp", "config.json")
920-
)
921-
)
915+
922916
logger.log("Creating workspace at \(workspaceFolder.forLogging)")
923917
logger.logFullObjectInMultipleLogMessages(header: "Workspace options", options.loggingProxy)
924918

0 commit comments

Comments
 (0)