Allow workspace options to affect build system search

There were a few places that options only took place *after* determining
a build system, even though we have multiple that impact the search (eg.
`defaultBuildSystem` and `searchPaths`).

Additionally track project root and configuration paths separately, so
that when searching for implicit workspaces we can make sure to skip
creating duplicates.

(cherry picked from commit 0c896696c9)
This commit is contained in:
Ben Barham
2024-12-13 16:59:57 -08:00
parent b7fbb47b65
commit 333e950df2
20 changed files with 528 additions and 379 deletions

View File

@@ -48,6 +48,8 @@ actor LegacyBuildServerBuildSystem: MessageHandler, BuiltInBuildSystem {
package let projectRoot: URL
package let configPath: URL
var fileWatchers: [FileSystemWatcher] = []
let indexDatabasePath: URL?
@@ -63,10 +65,12 @@ actor LegacyBuildServerBuildSystem: MessageHandler, BuiltInBuildSystem {
init(
projectRoot: URL,
configPath: URL,
initializationData: InitializeBuildResponse,
_ externalBuildSystemAdapter: ExternalBuildSystemAdapter
) async {
self.projectRoot = projectRoot
self.configPath = configPath
self.indexDatabasePath = nil
self.indexStorePath = nil
self.connectionToSourceKitLSP = LocalConnection(receiverName: "BuildSystemManager")