mirror of
https://github.com/apple/sourcekit-lsp.git
synced 2026-03-02 18:23:24 +01:00
Create BuildSystem in BuiltInBuildSystemAdapter
This finalizes the move of `BuiltInBuildSystem` creation into `BuiltInBuildSystemAdapter` and means that we can set the message handler of the `BuiltInBuildSystem` during initialization instead of using a setter method.
This commit is contained in:
@@ -50,10 +50,6 @@ package actor CompilationDatabaseBuildSystem {
|
||||
|
||||
package weak var messageHandler: BuiltInBuildSystemMessageHandler?
|
||||
|
||||
package func setMessageHandler(_ messageHandler: any BuiltInBuildSystemMessageHandler) {
|
||||
self.messageHandler = messageHandler
|
||||
}
|
||||
|
||||
package let projectRoot: AbsolutePath
|
||||
|
||||
let searchPaths: [RelativePath]
|
||||
@@ -87,11 +83,13 @@ package actor CompilationDatabaseBuildSystem {
|
||||
package init?(
|
||||
projectRoot: AbsolutePath,
|
||||
searchPaths: [RelativePath],
|
||||
messageHandler: (any BuiltInBuildSystemMessageHandler)?,
|
||||
fileSystem: FileSystem = localFileSystem
|
||||
) {
|
||||
self.fileSystem = fileSystem
|
||||
self.projectRoot = projectRoot
|
||||
self.searchPaths = searchPaths
|
||||
self.messageHandler = messageHandler
|
||||
if let compdb = tryLoadCompilationDatabase(directory: projectRoot, additionalSearchPaths: searchPaths, fileSystem) {
|
||||
self.compdb = compdb
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user