Skip to content

Remove warning message about missing compiler arguments #1489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions Sources/SourceKitLSP/Swift/SwiftLanguageService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -430,20 +430,6 @@ extension SwiftLanguageService {
}

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

let req = openDocumentSourcekitdRequest(snapshot: snapshot, compileCommand: buildSettings)
_ = try? await self.sourcekitd.send(req, fileContents: snapshot.text)
Expand Down
1 change: 0 additions & 1 deletion Tests/SourceKitLSPTests/BuildSystemTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ final class BuildSystemTests: XCTestCase {
let documentManager = await self.testClient.server.documentManager

testClient.openDocument(text, uri: doc)
_ = try await testClient.nextNotification(ofType: ShowMessageNotification.self)
let openDiags = try await testClient.nextDiagnosticsNotification()
XCTAssertEqual(openDiags.diagnostics.count, 1)
XCTAssertEqual(text, try documentManager.latestSnapshot(doc).text)
Expand Down