Skip to content

Commit 175e85e

Browse files
authored
Merge pull request #1398 from ahoppen/separate-index-log-in-client
Add an extension to the LogMessageNotification to add a message to a specific log in the client
2 parents 1fbb65e + c44ee45 commit 175e85e

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Sources/LanguageServerProtocol/Notifications/LogMessageNotification.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,15 @@ public struct LogMessageNotification: NotificationType, Hashable {
2424
/// The contents of the message.
2525
public var message: String
2626

27-
public init(type: WindowMessageType, message: String) {
27+
/// If specified, the client should log the message to a log with this name instead of the standard log for this LSP
28+
/// server.
29+
///
30+
/// **(LSP Extension)**
31+
public var logName: String?
32+
33+
public init(type: WindowMessageType, message: String, logName: String?) {
2834
self.type = type
2935
self.message = message
36+
self.logName = logName
3037
}
3138
}

Sources/SourceKitLSP/SourceKitLSPServer.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,8 @@ extension SourceKitLSPServer {
845845
\(result.taskDescription) finished in \(result.duration)
846846
\(result.command)
847847
\(result.output)
848-
"""
848+
""",
849+
logName: "SourceKit-LSP: Indexing"
849850
)
850851
)
851852
}

0 commit comments

Comments
 (0)