Skip to content

Commit 9f5c404

Browse files
authored
Merge pull request #1489 from ahoppen/no-notification-missing-compiler-args
Remove warning message about missing compiler arguments
2 parents bf336be + 30f1fd1 commit 9f5c404

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

Sources/SourceKitLSP/Swift/SwiftLanguageService.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -430,20 +430,6 @@ extension SwiftLanguageService {
430430
}
431431

432432
let buildSettings = await self.buildSettings(for: snapshot.uri)
433-
if buildSettings == nil || buildSettings!.isFallback, let fileUrl = notification.textDocument.uri.fileURL {
434-
// Do not show this notification for non-file URIs to make sure we don't see this notificaiton for newly created
435-
// files (which get opened as with a `untitled:Unitled-1` URI by VS Code.
436-
sourceKitLSPServer?.sendNotificationToClient(
437-
ShowMessageNotification(
438-
type: .warning,
439-
message: """
440-
Failed to get compiler arguments for \(fileUrl.lastPathComponent).
441-
Ensure the source file is part of a Swift package or has compiler arguments in compile_commands.json.
442-
Functionality will be limited.
443-
"""
444-
)
445-
)
446-
}
447433

448434
let req = openDocumentSourcekitdRequest(snapshot: snapshot, compileCommand: buildSettings)
449435
_ = try? await self.sourcekitd.send(req, fileContents: snapshot.text)

Tests/SourceKitLSPTests/BuildSystemTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,6 @@ final class BuildSystemTests: XCTestCase {
287287
let documentManager = await self.testClient.server.documentManager
288288

289289
testClient.openDocument(text, uri: doc)
290-
_ = try await testClient.nextNotification(ofType: ShowMessageNotification.self)
291290
let openDiags = try await testClient.nextDiagnosticsNotification()
292291
XCTAssertEqual(openDiags.diagnostics.count, 1)
293292
XCTAssertEqual(text, try documentManager.latestSnapshot(doc).text)

0 commit comments

Comments
 (0)