Skip to content

Commit a1f909a

Browse files
committed
Introduce a new sub-logging scope for the implicitly triggered publish diagnostics notification
Just makes it clearer why some logs are being triggered if you know that it’s for the publish diagnostics notification.
1 parent 7772f07 commit a1f909a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Sources/SourceKitLSP/Swift/SwiftLanguageServer.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,12 @@ extension SwiftLanguageServer {
367367
/// If the client doesn't support pull diagnostics, compute diagnostics for the latest version of the given document
368368
/// and send a `PublishDiagnosticsNotification` to the client for it.
369369
private func publishDiagnosticsIfNeeded(for document: DocumentURI) {
370+
withLoggingScope("publish-diagnostics") {
371+
publishDiagnosticsIfNeededImpl(for: document)
372+
}
373+
}
374+
375+
private func publishDiagnosticsIfNeededImpl(for document: DocumentURI) {
370376
guard enablePublishDiagnostics else {
371377
return
372378
}

0 commit comments

Comments
 (0)