Skip to content

Commit d9cd7ea

Browse files
committed
Update BSP connection build server config lookup path
Resolves #1695 Adopt `<workspace_root>/.bsp` search locations in addition to `<workspace_root>/`.
1 parent 9e2b1c9 commit d9cd7ea

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Sources/BuildSystemIntegration/ExternalBuildSystemAdapter.swift

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,18 @@ actor ExternalBuildSystemAdapter {
9494
private var lastRestart: Date?
9595

9696
static package func projectRoot(for workspaceFolder: AbsolutePath, options: SourceKitLSPOptions) -> AbsolutePath? {
97-
guard localFileSystem.isFile(workspaceFolder.appending(component: "buildServer.json")) else {
98-
return nil
97+
let buildServerConfigLocations = [
98+
workspaceFolder.appending(component: "buildServer.json"),
99+
workspaceFolder.appending(components: [".bsp", "buildServer.json"])
100+
]
101+
102+
for buildServerConfigLocation in buildServerConfigLocations {
103+
if localFileSystem.isFile(buildServerConfigLocation) {
104+
return workspaceFolder
105+
}
99106
}
100-
return workspaceFolder
107+
108+
return nil
101109
}
102110

103111
init(

0 commit comments

Comments
 (0)