mirror of
https://github.com/apple/sourcekit-lsp.git
synced 2026-03-02 18:23:24 +01:00
Introduce a notion of ConfiguredTargets into the build system
Instead of asking for build settings of a file, the build system manager asks for the targets of a file and then asks for the build settings of that file in a specific target. This has two advantages: - We know about targets and can prepare the targets for background indexing - Once we support build systems in which a single file can be part of multiple targets, we can have a centralized place that picks preferred targets for a file, eg. based on user configuration
This commit is contained in:
@@ -263,7 +263,11 @@ extension BuildServerBuildSystem: BuildSystem {
|
||||
///
|
||||
/// Returns `nil` if no build settings have been received from the build
|
||||
/// server yet or if no build settings are available for this file.
|
||||
public func buildSettings(for document: DocumentURI, language: Language) async -> FileBuildSettings? {
|
||||
public func buildSettings(
|
||||
for document: DocumentURI,
|
||||
in target: ConfiguredTarget,
|
||||
language: Language
|
||||
) async -> FileBuildSettings? {
|
||||
return buildSettings[document]
|
||||
}
|
||||
|
||||
@@ -271,6 +275,10 @@ extension BuildServerBuildSystem: BuildSystem {
|
||||
return nil
|
||||
}
|
||||
|
||||
public func configuredTargets(for document: DocumentURI) async -> [ConfiguredTarget] {
|
||||
return [ConfiguredTarget(targetID: "dummy", runDestinationID: "dummy")]
|
||||
}
|
||||
|
||||
public func registerForChangeNotifications(for uri: DocumentURI) {
|
||||
let request = RegisterForChanges(uri: uri, action: .register)
|
||||
_ = self.buildServer?.send(request) { result in
|
||||
|
||||
Reference in New Issue
Block a user