Skip to content

Commit 0249741

Browse files
committed
Remove indexPrefixMappings from BuildSystem
They weren’t used.
1 parent 5c2055d commit 0249741

File tree

8 files changed

+1
-18
lines changed

8 files changed

+1
-18
lines changed

Sources/BuildSystemIntegration/BuildServerBuildSystem.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ package actor BuildServerBuildSystem: MessageHandler {
7272
package private(set) var indexDatabasePath: AbsolutePath?
7373
package private(set) var indexStorePath: AbsolutePath?
7474

75-
// FIXME: Add support for prefix mappings to the Build Server protocol.
76-
package var indexPrefixMappings: [PathPrefixMapping] { return [] }
77-
7875
/// Delegate to handle any build system events.
7976
package weak var delegate: BuildSystemDelegate?
8077

Sources/BuildSystemIntegration/BuildSystem.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@ package protocol BuildSystem: AnyObject, Sendable {
107107
/// The path to put the index database, if any.
108108
var indexDatabasePath: AbsolutePath? { get async }
109109

110-
/// Path remappings for remapping index data for local use.
111-
var indexPrefixMappings: [PathPrefixMapping] { get async }
112-
113110
/// Delegate to handle any build system events such as file build settings initial reports as well as changes.
114111
///
115112
/// The build system must not retain the delegate because the delegate can be the `BuildSystemManager`, which could

Sources/BuildSystemIntegration/CompilationDatabaseBuildSystem.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ extension CompilationDatabaseBuildSystem: BuildSystem {
100100
indexStorePath?.parentDirectory.appending(component: "IndexDatabase")
101101
}
102102

103-
package var indexPrefixMappings: [PathPrefixMapping] { return [] }
104-
105103
package func buildSettings(
106104
for document: DocumentURI,
107105
in buildTarget: ConfiguredTarget,

Sources/BuildSystemIntegration/FallbackBuildSystem.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ package actor FallbackBuildSystem {
4949

5050
package var indexDatabasePath: AbsolutePath? { return nil }
5151

52-
package var indexPrefixMappings: [PathPrefixMapping] { return [] }
53-
5452
package func buildSettings(for uri: DocumentURI, language: Language) -> FileBuildSettings? {
5553
var fileBuildSettings: FileBuildSettings?
5654
switch language {

Sources/BuildSystemIntegration/SwiftPMBuildSystem.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,8 +455,6 @@ extension SwiftPMBuildSystem: BuildSystemIntegration.BuildSystem {
455455
return buildPath.appending(components: "index", "db")
456456
}
457457

458-
package var indexPrefixMappings: [PathPrefixMapping] { return [] }
459-
460458
/// Return the compiler arguments for the given source file within a target, making any necessary adjustments to
461459
/// account for differences in the SwiftPM versions being linked into SwiftPM and being installed in the toolchain.
462460
private func compilerArguments(for file: DocumentURI, in buildTarget: any SwiftBuildTarget) async throws -> [String] {

Sources/SourceKitLSP/Workspace.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,7 @@ package final class Workspace: Sendable {
178178
let lib = try IndexStoreLibrary(dylibPath: libPath.pathString)
179179
indexDelegate = SourceKitIndexDelegate()
180180
let prefixMappings =
181-
await firstNonNil(
182-
indexOptions.indexPrefixMap?.map { PathPrefixMapping(original: $0.key, replacement: $0.value) },
183-
await buildSystem?.indexPrefixMappings
184-
) ?? []
181+
indexOptions.indexPrefixMap?.map { PathPrefixMapping(original: $0.key, replacement: $0.value) } ?? []
185182
index = try IndexStoreDB(
186183
storePath: storePath.pathString,
187184
databasePath: dbPath.pathString,

Tests/BuildSystemIntegrationTests/BuildSystemManagerTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,6 @@ class ManualBuildSystem: BuildSystem {
500500

501501
var indexStorePath: AbsolutePath? { nil }
502502
var indexDatabasePath: AbsolutePath? { nil }
503-
var indexPrefixMappings: [PathPrefixMapping] { return [] }
504503

505504
func filesDidChange(_ events: [FileEvent]) {}
506505

Tests/SourceKitLSPTests/BuildSystemTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ actor TestBuildSystem: BuildSystem {
2727
let projectRoot: AbsolutePath = try! AbsolutePath(validating: "/")
2828
let indexStorePath: AbsolutePath? = nil
2929
let indexDatabasePath: AbsolutePath? = nil
30-
let indexPrefixMappings: [PathPrefixMapping] = []
3130

3231
weak var delegate: BuildSystemDelegate?
3332

0 commit comments

Comments
 (0)