Skip to content

Commit 5183889

Browse files
authored
Merge pull request #1872 from ahoppen/no-background-indexing-warning
Don’t show warning message when opening projects that don't support background indexing
2 parents fad3c10 + cbd897d commit 5183889

File tree

2 files changed

+0
-31
lines changed

2 files changed

+0
-31
lines changed

Sources/SourceKitLSP/SourceKitLSPServer.swift

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,6 @@ package actor SourceKitLSPServer {
8484
/// Initialization can be awaited using `waitUntilInitialized`.
8585
private var initialized: Bool = false
8686

87-
/// Set to `true` after the user has opened a project that doesn't support background indexing while having background
88-
/// indexing enabled.
89-
///
90-
/// This ensures that we only inform the user about background indexing not being supported for these projects once.
91-
private var didSendBackgroundIndexingNotSupportedNotification = false
92-
9387
var options: SourceKitLSPOptions
9488

9589
let testHooks: TestHooks
@@ -841,20 +835,6 @@ extension SourceKitLSPServer {
841835
testHooks: testHooks,
842836
indexTaskScheduler: indexTaskScheduler
843837
)
844-
if options.backgroundIndexingOrDefault, workspace.semanticIndexManager == nil,
845-
!self.didSendBackgroundIndexingNotSupportedNotification
846-
{
847-
self.sendNotificationToClient(
848-
ShowMessageNotification(
849-
type: .info,
850-
message: """
851-
Background indexing is currently only supported for SwiftPM projects. \
852-
For all other project types, please run a build to update the index.
853-
"""
854-
)
855-
)
856-
self.didSendBackgroundIndexingNotSupportedNotification = true
857-
}
858838
return workspace
859839
}
860840

Tests/SourceKitLSPTests/BackgroundIndexingTests.swift

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -885,17 +885,6 @@ final class BackgroundIndexingTests: XCTestCase {
885885
)
886886
}
887887

888-
func testShowMessageWhenOpeningAProjectThatDoesntSupportBackgroundIndexing() async throws {
889-
let project = try await MultiFileTestProject(
890-
files: [
891-
"compile_commands.json": ""
892-
],
893-
enableBackgroundIndexing: true
894-
)
895-
let message = try await project.testClient.nextNotification(ofType: ShowMessageNotification.self)
896-
XCTAssert(message.message.contains("Background indexing"), "Received unexpected message: \(message.message)")
897-
}
898-
899888
func testNoPreparationStatusIfTargetIsUpToDate() async throws {
900889
let project = try await SwiftPMTestProject(
901890
files: [

0 commit comments

Comments
 (0)