Skip to content

Commit d0e7d81

Browse files
committed
Finetune the wordings and logics
1 parent 50870e3 commit d0e7d81

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sources/SourceKitLSP/Swift/DiagnosticReportManager.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import SourceKitD
1616
import SwiftParserDiagnostics
1717

1818
actor DiagnosticReportManager {
19-
/// A task that gets report from sourcekitd
19+
/// A task to produce diagnostics, either from a diagnostics request to `sourcektid` or by using the built-in swift-syntax.
2020
private typealias ReportTask = Task<RelatedFullDocumentDiagnosticReport, Error>
2121

2222
private let sourcekitd: SourceKitD
@@ -60,8 +60,8 @@ actor DiagnosticReportManager {
6060
for snapshot: DocumentSnapshot,
6161
buildSettings: SwiftCompileCommand?
6262
) async throws -> RelatedFullDocumentDiagnosticReport {
63-
if let report = try await reportTask(for: snapshot.id, buildSettings: buildSettings)?.value {
64-
return report
63+
if let reportTask = reportTask(for: snapshot.id, buildSettings: buildSettings) {
64+
return try await reportTask.value
6565
}
6666
let reportTask: Task<RelatedFullDocumentDiagnosticReport, Error>
6767
if let buildSettings, !buildSettings.isFallback {
@@ -70,7 +70,7 @@ actor DiagnosticReportManager {
7070
}
7171
} else {
7272
logger.log(
73-
"Producing syntactic diagnostics from the built-in swift-syntax because we \(buildSettings != nil ? "have fallback build settings" : "don't have build settings")"
73+
"Producing syntactic diagnostics from the built-in swift-syntax because we \(buildSettings != nil ? "have fallback build settings" : "don't have build settings", privacy: .public))"
7474
)
7575
// If we don't have build settings or we only have fallback build settings,
7676
// sourcekitd won't be able to give us accurate semantic diagnostics.

0 commit comments

Comments
 (0)