From ea2e15bd080702091b0cf5ce9869c86f4da87762 Mon Sep 17 00:00:00 2001 From: Ben Langmuir Date: Fri, 7 Dec 2018 22:29:02 -0800 Subject: [PATCH] [lsp] Document the logMessage notification and split into its own file --- .../LanguageServerProtocol/LogMessage.swift | 31 +++++++++++++++++++ Sources/LanguageServerProtocol/Messages.swift | 15 --------- 2 files changed, 31 insertions(+), 15 deletions(-) create mode 100644 Sources/LanguageServerProtocol/LogMessage.swift diff --git a/Sources/LanguageServerProtocol/LogMessage.swift b/Sources/LanguageServerProtocol/LogMessage.swift new file mode 100644 index 00000000..192e55ef --- /dev/null +++ b/Sources/LanguageServerProtocol/LogMessage.swift @@ -0,0 +1,31 @@ +//===----------------------------------------------------------------------===// +// +// This source file is part of the Swift.org open source project +// +// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors +// Licensed under Apache License v2.0 with Runtime Library Exception +// +// See https://swift.org/LICENSE.txt for license information +// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors +// +//===----------------------------------------------------------------------===// + +/// Notifcation from the server containing a log message. +/// +/// - Parameters: +/// - type: The kind of log message. +/// - message: The contents of the message. +public struct LogMessage: NotificationType, Hashable { + public static let method: String = "window/logMessage" + + /// The kind of log message. + public var type: WindowMessageType + + /// The contents of the message. + public var message: String + + public init(type: WindowMessageType, message: String) { + self.type = type + self.message = message + } +} \ No newline at end of file diff --git a/Sources/LanguageServerProtocol/Messages.swift b/Sources/LanguageServerProtocol/Messages.swift index 7e3d60bc..99706a92 100644 --- a/Sources/LanguageServerProtocol/Messages.swift +++ b/Sources/LanguageServerProtocol/Messages.swift @@ -159,21 +159,6 @@ public struct Exit: NotificationType, Hashable { public static let method: String = "exit" } -// MARK: - Window - - -public struct LogMessage: NotificationType, Hashable { - public static let method: String = "window/logMessage" - - public var type: WindowMessageType - - public var message: String - - public init(type: WindowMessageType, message: String) { - self.type = type - self.message = message - } -} - public protocol TextDocumentRequest: RequestType { var textDocument: TextDocumentIdentifier { get }