diff --git a/Sources/BuildServerProtocol/CMakeLists.txt b/Sources/BuildServerProtocol/CMakeLists.txt index 53a7d6cba..4c94ac5c0 100644 --- a/Sources/BuildServerProtocol/CMakeLists.txt +++ b/Sources/BuildServerProtocol/CMakeLists.txt @@ -4,6 +4,7 @@ add_library(BuildServerProtocol Messages/BuildShutdownRequest.swift Messages/BuildTargetPrepareRequest.swift Messages/BuildTargetSourcesRequest.swift + Messages/CancelRequestNotification.swift Messages/InitializeBuildRequest.swift Messages/OnBuildExitNotification.swift Messages/OnBuildInitializedNotification.swift diff --git a/Sources/BuildServerProtocol/Messages.swift b/Sources/BuildServerProtocol/Messages.swift index 789ecd499..44b4c355b 100644 --- a/Sources/BuildServerProtocol/Messages.swift +++ b/Sources/BuildServerProtocol/Messages.swift @@ -12,6 +12,9 @@ public import LanguageServerProtocol +public protocol BSPRequest: RequestType {} +public protocol BSPNotification: NotificationType {} + private let requestTypes: [_RequestType.Type] = [ BuildShutdownRequest.self, BuildTargetPrepareRequest.self, diff --git a/Sources/BuildServerProtocol/Messages/BuildShutdownRequest.swift b/Sources/BuildServerProtocol/Messages/BuildShutdownRequest.swift index b9d0a252e..21e824a7f 100644 --- a/Sources/BuildServerProtocol/Messages/BuildShutdownRequest.swift +++ b/Sources/BuildServerProtocol/Messages/BuildShutdownRequest.swift @@ -17,7 +17,7 @@ public import LanguageServerProtocol /// but to not exit (otherwise the response might not be delivered /// correctly to the client). There is a separate exit notification /// that asks the server to exit. -public struct BuildShutdownRequest: RequestType { +public struct BuildShutdownRequest: BSPRequest { public static let method: String = "build/shutdown" public typealias Response = VoidResponse diff --git a/Sources/BuildServerProtocol/Messages/BuildTargetPrepareRequest.swift b/Sources/BuildServerProtocol/Messages/BuildTargetPrepareRequest.swift index b0fa54648..1ddb83dde 100644 --- a/Sources/BuildServerProtocol/Messages/BuildTargetPrepareRequest.swift +++ b/Sources/BuildServerProtocol/Messages/BuildTargetPrepareRequest.swift @@ -25,7 +25,7 @@ public typealias OriginId = String /// /// The server communicates during the initialize handshake whether this method is supported or not by setting /// `prepareProvider: true` in `SourceKitInitializeBuildResponseData`. -public struct BuildTargetPrepareRequest: RequestType, Hashable { +public struct BuildTargetPrepareRequest: BSPRequest, Hashable { public static let method: String = "buildTarget/prepare" public typealias Response = VoidResponse diff --git a/Sources/BuildServerProtocol/Messages/BuildTargetSourcesRequest.swift b/Sources/BuildServerProtocol/Messages/BuildTargetSourcesRequest.swift index ec3722b9f..4342f4719 100644 --- a/Sources/BuildServerProtocol/Messages/BuildTargetSourcesRequest.swift +++ b/Sources/BuildServerProtocol/Messages/BuildTargetSourcesRequest.swift @@ -16,7 +16,7 @@ public import LanguageServerProtocol /// query for the list of text documents and directories that belong to a /// build target. The sources response must not include sources that are /// external to the workspace. -public struct BuildTargetSourcesRequest: RequestType, Hashable { +public struct BuildTargetSourcesRequest: BSPRequest, Hashable { public static let method: String = "buildTarget/sources" public typealias Response = BuildTargetSourcesResponse diff --git a/Sources/BuildServerProtocol/Messages/CancelRequestNotification.swift b/Sources/BuildServerProtocol/Messages/CancelRequestNotification.swift new file mode 100644 index 000000000..7f110f710 --- /dev/null +++ b/Sources/BuildServerProtocol/Messages/CancelRequestNotification.swift @@ -0,0 +1,15 @@ +//===----------------------------------------------------------------------===// +// +// This source file is part of the Swift.org open source project +// +// Copyright (c) 2014 - 2019 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 +// +//===----------------------------------------------------------------------===// + +public import LanguageServerProtocol + +extension CancelRequestNotification: BSPNotification {} diff --git a/Sources/BuildServerProtocol/Messages/InitializeBuildRequest.swift b/Sources/BuildServerProtocol/Messages/InitializeBuildRequest.swift index 15c720d70..fc4632b3f 100644 --- a/Sources/BuildServerProtocol/Messages/InitializeBuildRequest.swift +++ b/Sources/BuildServerProtocol/Messages/InitializeBuildRequest.swift @@ -26,7 +26,7 @@ public import LanguageServerProtocol /// Until the server has responded to the initialize request with an /// InitializeBuildResult, the client must not send any additional /// requests or notifications to the server. -public struct InitializeBuildRequest: RequestType, Hashable { +public struct InitializeBuildRequest: BSPRequest, Hashable { public static let method: String = "build/initialize" public typealias Response = InitializeBuildResponse diff --git a/Sources/BuildServerProtocol/Messages/OnBuildExitNotification.swift b/Sources/BuildServerProtocol/Messages/OnBuildExitNotification.swift index 3c3a66f17..1598d25fa 100644 --- a/Sources/BuildServerProtocol/Messages/OnBuildExitNotification.swift +++ b/Sources/BuildServerProtocol/Messages/OnBuildExitNotification.swift @@ -10,13 +10,11 @@ // //===----------------------------------------------------------------------===// -public import LanguageServerProtocol - /// Like the language server protocol, a notification to ask the /// server to exit its process. The server should exit with success /// code 0 if the shutdown request has been received before; /// otherwise with error code 1. -public struct OnBuildExitNotification: NotificationType { +public struct OnBuildExitNotification: BSPNotification { public static let method: String = "build/exit" public init() {} diff --git a/Sources/BuildServerProtocol/Messages/OnBuildInitializedNotification.swift b/Sources/BuildServerProtocol/Messages/OnBuildInitializedNotification.swift index f1a1e26a3..0b3e207d8 100644 --- a/Sources/BuildServerProtocol/Messages/OnBuildInitializedNotification.swift +++ b/Sources/BuildServerProtocol/Messages/OnBuildInitializedNotification.swift @@ -10,10 +10,8 @@ // //===----------------------------------------------------------------------===// -public import LanguageServerProtocol - /// Like the language server protocol, the initialized notification is sent from the client to the server after the client received the result of the initialize request but before the client is sending any other request or notification to the server. The server can use the initialized notification for example to initialize intensive computation such as dependency resolution or compilation. The initialized notification may only be sent once. -public struct OnBuildInitializedNotification: NotificationType { +public struct OnBuildInitializedNotification: BSPNotification { public static let method: String = "build/initialized" public init() {} diff --git a/Sources/BuildServerProtocol/Messages/OnBuildLogMessageNotification.swift b/Sources/BuildServerProtocol/Messages/OnBuildLogMessageNotification.swift index b9b5bd5dd..a3008aae3 100644 --- a/Sources/BuildServerProtocol/Messages/OnBuildLogMessageNotification.swift +++ b/Sources/BuildServerProtocol/Messages/OnBuildLogMessageNotification.swift @@ -10,12 +10,10 @@ // //===----------------------------------------------------------------------===// -public import LanguageServerProtocol - /// The log message notification is sent from a server to a client to ask the client to log a particular message in its console. /// /// A `build/logMessage`` notification is similar to LSP's `window/logMessage``, except for a few additions like id and originId. -public struct OnBuildLogMessageNotification: NotificationType { +public struct OnBuildLogMessageNotification: BSPNotification { public static let method: String = "build/logMessage" /// The message type. diff --git a/Sources/BuildServerProtocol/Messages/OnBuildTargetDidChangeNotification.swift b/Sources/BuildServerProtocol/Messages/OnBuildTargetDidChangeNotification.swift index 592d78b92..8dc6b3b9a 100644 --- a/Sources/BuildServerProtocol/Messages/OnBuildTargetDidChangeNotification.swift +++ b/Sources/BuildServerProtocol/Messages/OnBuildTargetDidChangeNotification.swift @@ -15,7 +15,7 @@ public import LanguageServerProtocol /// The build target changed notification is sent from the server to the client /// to signal a change in a build target. The server communicates during the /// initialize handshake whether this method is supported or not. -public struct OnBuildTargetDidChangeNotification: NotificationType, Equatable { +public struct OnBuildTargetDidChangeNotification: BSPNotification, Equatable { public static let method: String = "buildTarget/didChange" /// **(BSP Extension)** diff --git a/Sources/BuildServerProtocol/Messages/OnWatchedFilesDidChangeNotification.swift b/Sources/BuildServerProtocol/Messages/OnWatchedFilesDidChangeNotification.swift index 656cf109f..82b88c730 100644 --- a/Sources/BuildServerProtocol/Messages/OnWatchedFilesDidChangeNotification.swift +++ b/Sources/BuildServerProtocol/Messages/OnWatchedFilesDidChangeNotification.swift @@ -14,3 +14,5 @@ public import LanguageServerProtocol /// Notification sent from SourceKit-LSP to the build server to indicate that files within the project have been modified. public typealias OnWatchedFilesDidChangeNotification = LanguageServerProtocol.DidChangeWatchedFilesNotification + +extension OnWatchedFilesDidChangeNotification: BSPNotification {} diff --git a/Sources/BuildServerProtocol/Messages/RegisterForChangeNotifications.swift b/Sources/BuildServerProtocol/Messages/RegisterForChangeNotifications.swift index 1b408397a..b2d719f28 100644 --- a/Sources/BuildServerProtocol/Messages/RegisterForChangeNotifications.swift +++ b/Sources/BuildServerProtocol/Messages/RegisterForChangeNotifications.swift @@ -20,7 +20,7 @@ public import LanguageServerProtocol /// - Important: This request has been deprecated. Build servers should instead implement the /// `textDocument/sourceKitOptions` request. /// See https://forums.swift.org/t/extending-functionality-of-build-server-protocol-with-sourcekit-lsp/74400 -public struct RegisterForChanges: RequestType { +public struct RegisterForChanges: BSPRequest { public static let method: String = "textDocument/registerForChanges" public typealias Response = VoidResponse @@ -48,7 +48,7 @@ public enum RegisterAction: String, Hashable, Codable, Sendable { /// - Important: This request has been deprecated. Build servers should instead implement the /// `textDocument/sourceKitOptions` request. /// See https://forums.swift.org/t/extending-functionality-of-build-server-protocol-with-sourcekit-lsp/74400 -public struct FileOptionsChangedNotification: NotificationType { +public struct FileOptionsChangedNotification: BSPNotification { public struct Options: ResponseType, Hashable { /// The compiler options required for the requested file. public var options: [String] diff --git a/Sources/BuildServerProtocol/Messages/TaskFinishNotification.swift b/Sources/BuildServerProtocol/Messages/TaskFinishNotification.swift index 4bcb54f21..9504fd137 100644 --- a/Sources/BuildServerProtocol/Messages/TaskFinishNotification.swift +++ b/Sources/BuildServerProtocol/Messages/TaskFinishNotification.swift @@ -14,7 +14,7 @@ public import Foundation public import LanguageServerProtocol /// A `build/taskFinish` notification must always be sent after a `build/taskStart`` with the same `taskId` was sent. -public struct TaskFinishNotification: NotificationType { +public struct TaskFinishNotification: BSPNotification { public static let method: String = "build/taskFinish" /// Unique id of the task with optional reference to parent task id. diff --git a/Sources/BuildServerProtocol/Messages/TaskProgressNotification.swift b/Sources/BuildServerProtocol/Messages/TaskProgressNotification.swift index d4cfd3dc7..c7286daf6 100644 --- a/Sources/BuildServerProtocol/Messages/TaskProgressNotification.swift +++ b/Sources/BuildServerProtocol/Messages/TaskProgressNotification.swift @@ -15,7 +15,7 @@ public import LanguageServerProtocol /// After a `taskStart` and before `taskFinish` for a `taskId`, the server may send any number of progress /// notifications. -public struct TaskProgressNotification: NotificationType { +public struct TaskProgressNotification: BSPNotification { public static let method: String = "build/taskProgress" /// Unique id of the task with optional reference to parent task id diff --git a/Sources/BuildServerProtocol/Messages/TaskStartNotification.swift b/Sources/BuildServerProtocol/Messages/TaskStartNotification.swift index 444ee0c35..ea3ba83aa 100644 --- a/Sources/BuildServerProtocol/Messages/TaskStartNotification.swift +++ b/Sources/BuildServerProtocol/Messages/TaskStartNotification.swift @@ -30,7 +30,7 @@ public import LanguageServerProtocol /// /// Tasks that are spawned by another task should reference the originating task's `taskId` in their own `taskId`'s /// `parent` field. Tasks spawned directly by a request should reference the request's `originId` parent. -public struct TaskStartNotification: NotificationType { +public struct TaskStartNotification: BSPNotification { public static let method: String = "build/taskStart" /// Unique id of the task with optional reference to parent task id diff --git a/Sources/BuildServerProtocol/Messages/TextDocumentSourceKitOptionsRequest.swift b/Sources/BuildServerProtocol/Messages/TextDocumentSourceKitOptionsRequest.swift index fc008c15c..8cfb7c944 100644 --- a/Sources/BuildServerProtocol/Messages/TextDocumentSourceKitOptionsRequest.swift +++ b/Sources/BuildServerProtocol/Messages/TextDocumentSourceKitOptionsRequest.swift @@ -19,7 +19,7 @@ public import LanguageServerProtocol /// `DidChangeBuildTargetNotification` is sent for the requested target. /// /// The request may return `nil` if it doesn't have any build settings for this file in the given target. -public struct TextDocumentSourceKitOptionsRequest: RequestType, Hashable { +public struct TextDocumentSourceKitOptionsRequest: BSPRequest, Hashable { public static let method: String = "textDocument/sourceKitOptions" public typealias Response = TextDocumentSourceKitOptionsResponse? diff --git a/Sources/BuildServerProtocol/Messages/WorkspaceBuildTargetsRequest.swift b/Sources/BuildServerProtocol/Messages/WorkspaceBuildTargetsRequest.swift index 24991c588..86d18fe17 100644 --- a/Sources/BuildServerProtocol/Messages/WorkspaceBuildTargetsRequest.swift +++ b/Sources/BuildServerProtocol/Messages/WorkspaceBuildTargetsRequest.swift @@ -14,7 +14,7 @@ public import LanguageServerProtocol /// The workspace build targets request is sent from the client to the server to /// ask for the list of all available build targets in the workspace. -public struct WorkspaceBuildTargetsRequest: RequestType, Hashable { +public struct WorkspaceBuildTargetsRequest: BSPRequest, Hashable { public static let method: String = "workspace/buildTargets" public typealias Response = WorkspaceBuildTargetsResponse diff --git a/Sources/BuildServerProtocol/Messages/WorkspaceWaitForBuildSystemUpdates.swift b/Sources/BuildServerProtocol/Messages/WorkspaceWaitForBuildSystemUpdates.swift index 3fa579ade..06b72f452 100644 --- a/Sources/BuildServerProtocol/Messages/WorkspaceWaitForBuildSystemUpdates.swift +++ b/Sources/BuildServerProtocol/Messages/WorkspaceWaitForBuildSystemUpdates.swift @@ -16,7 +16,7 @@ public import LanguageServerProtocol /// /// If the build server is currently updating the build graph, this request should return after those updates have /// finished processing. -public struct WorkspaceWaitForBuildSystemUpdatesRequest: RequestType, Hashable { +public struct WorkspaceWaitForBuildSystemUpdatesRequest: BSPRequest, Hashable { public typealias Response = VoidResponse public static let method: String = "workspace/waitForBuildSystemUpdates" diff --git a/Sources/LanguageServerProtocol/Message.swift b/Sources/LanguageServerProtocol/Message.swift index 97c1d5972..7732a7fe6 100644 --- a/Sources/LanguageServerProtocol/Message.swift +++ b/Sources/LanguageServerProtocol/Message.swift @@ -63,14 +63,17 @@ extension NotificationType { } } +public protocol LSPRequest: RequestType {} +public protocol LSPNotification: NotificationType {} + /// A `textDocument/*` notification, which takes a text document identifier /// indicating which document it operates in or on. -public protocol TextDocumentNotification: NotificationType { +public protocol TextDocumentNotification: LSPNotification { var textDocument: TextDocumentIdentifier { get } } /// A `textDocument/*` request, which takes a text document identifier /// indicating which document it operates in or on. -public protocol TextDocumentRequest: RequestType { +public protocol TextDocumentRequest: LSPRequest { var textDocument: TextDocumentIdentifier { get } } diff --git a/Sources/LanguageServerProtocol/Notifications/CancelRequestNotification.swift b/Sources/LanguageServerProtocol/Notifications/CancelRequestNotification.swift index e6e4f22a3..2e0cfa654 100644 --- a/Sources/LanguageServerProtocol/Notifications/CancelRequestNotification.swift +++ b/Sources/LanguageServerProtocol/Notifications/CancelRequestNotification.swift @@ -18,7 +18,7 @@ /// As with any `$` requests, the server is free to ignore this notification. /// /// - Parameter id: The request to cancel. -public struct CancelRequestNotification: NotificationType, Hashable { +public struct CancelRequestNotification: LSPNotification, Hashable { public static let method: String = "$/cancelRequest" /// The request to cancel. diff --git a/Sources/LanguageServerProtocol/Notifications/CancelWorkDoneProgressNotification.swift b/Sources/LanguageServerProtocol/Notifications/CancelWorkDoneProgressNotification.swift index 5d2d9d86f..c3a017fce 100644 --- a/Sources/LanguageServerProtocol/Notifications/CancelWorkDoneProgressNotification.swift +++ b/Sources/LanguageServerProtocol/Notifications/CancelWorkDoneProgressNotification.swift @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -public struct CancelWorkDoneProgressNotification: NotificationType { +public struct CancelWorkDoneProgressNotification: LSPNotification { public static let method: String = "window/workDoneProgress/cancel" public var token: ProgressToken diff --git a/Sources/LanguageServerProtocol/Notifications/ConfigurationNotification.swift b/Sources/LanguageServerProtocol/Notifications/ConfigurationNotification.swift index 8de9bbb6a..7df2b3653 100644 --- a/Sources/LanguageServerProtocol/Notifications/ConfigurationNotification.swift +++ b/Sources/LanguageServerProtocol/Notifications/ConfigurationNotification.swift @@ -15,7 +15,7 @@ /// - Note: the format of the settings is implementation-defined. /// /// - Parameter settings: The changed workspace settings. -public struct DidChangeConfigurationNotification: NotificationType { +public struct DidChangeConfigurationNotification: LSPNotification { public static let method: String = "workspace/didChangeConfiguration" /// The changed workspace settings. diff --git a/Sources/LanguageServerProtocol/Notifications/DidChangeActiveDocumentNotification.swift b/Sources/LanguageServerProtocol/Notifications/DidChangeActiveDocumentNotification.swift index 1227b1606..d098483d0 100644 --- a/Sources/LanguageServerProtocol/Notifications/DidChangeActiveDocumentNotification.swift +++ b/Sources/LanguageServerProtocol/Notifications/DidChangeActiveDocumentNotification.swift @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -public struct DidChangeActiveDocumentNotification: NotificationType { +public struct DidChangeActiveDocumentNotification: LSPNotification { public static let method: String = "window/didChangeActiveDocument" /// The document that is being displayed in the active editor or `null` to indicate that either no document is active diff --git a/Sources/LanguageServerProtocol/Notifications/DidChangeFileNotifications.swift b/Sources/LanguageServerProtocol/Notifications/DidChangeFileNotifications.swift index d22c6a6d3..f4397d5e9 100644 --- a/Sources/LanguageServerProtocol/Notifications/DidChangeFileNotifications.swift +++ b/Sources/LanguageServerProtocol/Notifications/DidChangeFileNotifications.swift @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -public struct DidCreateFilesNotification: NotificationType { +public struct DidCreateFilesNotification: LSPNotification { public static let method: String = "workspace/didCreateFiles" /// An array of all files/folders created in this operation. @@ -21,7 +21,7 @@ public struct DidCreateFilesNotification: NotificationType { } } -public struct DidRenameFilesNotification: NotificationType { +public struct DidRenameFilesNotification: LSPNotification { public static let method: String = "workspace/didRenameFiles" /// An array of all files/folders renamed in this operation. When a folder @@ -33,7 +33,7 @@ public struct DidRenameFilesNotification: NotificationType { } } -public struct DidDeleteFilesNotification: NotificationType { +public struct DidDeleteFilesNotification: LSPNotification { public static let method: String = "workspace/didDeleteFiles" /// An array of all files/folders created in this operation. diff --git a/Sources/LanguageServerProtocol/Notifications/DidChangeWatchedFilesNotification.swift b/Sources/LanguageServerProtocol/Notifications/DidChangeWatchedFilesNotification.swift index 72fdd247a..fcf5e0de5 100644 --- a/Sources/LanguageServerProtocol/Notifications/DidChangeWatchedFilesNotification.swift +++ b/Sources/LanguageServerProtocol/Notifications/DidChangeWatchedFilesNotification.swift @@ -13,7 +13,7 @@ /// Notification from the client when changes to watched files are detected. /// /// - Parameter changes: The set of file changes. -public struct DidChangeWatchedFilesNotification: NotificationType { +public struct DidChangeWatchedFilesNotification: LSPNotification { public static let method: String = "workspace/didChangeWatchedFiles" /// The file changes. diff --git a/Sources/LanguageServerProtocol/Notifications/DidChangeWorkspaceFoldersNotification.swift b/Sources/LanguageServerProtocol/Notifications/DidChangeWorkspaceFoldersNotification.swift index b8b9a9c50..ec7fdf4d7 100644 --- a/Sources/LanguageServerProtocol/Notifications/DidChangeWorkspaceFoldersNotification.swift +++ b/Sources/LanguageServerProtocol/Notifications/DidChangeWorkspaceFoldersNotification.swift @@ -15,7 +15,7 @@ /// - Parameter event: The set of changes. /// /// Requires the `workspaceFolders` capability on both the client and server. -public struct DidChangeWorkspaceFoldersNotification: NotificationType { +public struct DidChangeWorkspaceFoldersNotification: LSPNotification { public static let method: String = "workspace/didChangeWorkspaceFolders" /// The set of changes. diff --git a/Sources/LanguageServerProtocol/Notifications/ExitNotification.swift b/Sources/LanguageServerProtocol/Notifications/ExitNotification.swift index e47e7b5f4..24084aab5 100644 --- a/Sources/LanguageServerProtocol/Notifications/ExitNotification.swift +++ b/Sources/LanguageServerProtocol/Notifications/ExitNotification.swift @@ -13,7 +13,7 @@ /// Notification that the server process should exit. /// /// This notification will come after the shutdown request finishes. -public struct ExitNotification: NotificationType, Hashable { +public struct ExitNotification: LSPNotification, Hashable { public static let method: String = "exit" public init() {} } diff --git a/Sources/LanguageServerProtocol/Notifications/InitializedNotification.swift b/Sources/LanguageServerProtocol/Notifications/InitializedNotification.swift index d8bf05e7c..052ef5ad6 100644 --- a/Sources/LanguageServerProtocol/Notifications/InitializedNotification.swift +++ b/Sources/LanguageServerProtocol/Notifications/InitializedNotification.swift @@ -11,7 +11,7 @@ //===----------------------------------------------------------------------===// /// Notification from the client that its own initialization of the language server has finished. -public struct InitializedNotification: NotificationType, Hashable { +public struct InitializedNotification: LSPNotification, Hashable { public static let method: String = "initialized" public init() {} diff --git a/Sources/LanguageServerProtocol/Notifications/LogMessageNotification.swift b/Sources/LanguageServerProtocol/Notifications/LogMessageNotification.swift index eee2f4660..32ba39e64 100644 --- a/Sources/LanguageServerProtocol/Notifications/LogMessageNotification.swift +++ b/Sources/LanguageServerProtocol/Notifications/LogMessageNotification.swift @@ -15,7 +15,7 @@ /// - Parameters: /// - type: The kind of log message. /// - message: The contents of the message. -public struct LogMessageNotification: NotificationType, Hashable { +public struct LogMessageNotification: LSPNotification, Hashable { public static let method: String = "window/logMessage" /// The kind of log message. diff --git a/Sources/LanguageServerProtocol/Notifications/LogTraceNotification.swift b/Sources/LanguageServerProtocol/Notifications/LogTraceNotification.swift index 2027703f5..2e911c993 100644 --- a/Sources/LanguageServerProtocol/Notifications/LogTraceNotification.swift +++ b/Sources/LanguageServerProtocol/Notifications/LogTraceNotification.swift @@ -13,7 +13,7 @@ /// A notification to log the trace of the server’s execution. The amount and content of these notifications depends on the current trace configuration. If trace is 'off', the server should not send any logTrace notification. If trace is 'messages', the server should not add the 'verbose' field in the LogTraceParams. /// /// $/logTrace should be used for systematic trace reporting. For single debugging messages, the server should send window/logMessage notifications. -public struct LogTraceNotification: NotificationType, Hashable, Codable { +public struct LogTraceNotification: LSPNotification, Hashable, Codable { public static let method: String = "$/logTrace" /// The message to be logged. diff --git a/Sources/LanguageServerProtocol/Notifications/PublishDiagnosticsNotification.swift b/Sources/LanguageServerProtocol/Notifications/PublishDiagnosticsNotification.swift index 1d41be0ba..35ca2291d 100644 --- a/Sources/LanguageServerProtocol/Notifications/PublishDiagnosticsNotification.swift +++ b/Sources/LanguageServerProtocol/Notifications/PublishDiagnosticsNotification.swift @@ -24,7 +24,7 @@ /// - Parameters: /// - uri: The document in which the diagnostics should be shown. /// - diagnostics: The complete list of diagnostics in the document, if any. -public struct PublishDiagnosticsNotification: NotificationType, Hashable, Codable { +public struct PublishDiagnosticsNotification: LSPNotification, Hashable, Codable { public static let method: String = "textDocument/publishDiagnostics" /// The document in which the diagnostics should be shown. diff --git a/Sources/LanguageServerProtocol/Notifications/ReopenTextDocumentNotifications.swift b/Sources/LanguageServerProtocol/Notifications/ReopenTextDocumentNotifications.swift index fb1f8a8a1..504ef6ee1 100644 --- a/Sources/LanguageServerProtocol/Notifications/ReopenTextDocumentNotifications.swift +++ b/Sources/LanguageServerProtocol/Notifications/ReopenTextDocumentNotifications.swift @@ -17,7 +17,7 @@ /// request for this document is executing at the same time. /// /// **(LSP Extension)** -public struct ReopenTextDocumentNotification: NotificationType, Hashable { +public struct ReopenTextDocumentNotification: LSPNotification, Hashable { public static let method: String = "textDocument/reopen" /// The document identifier and initial contents. diff --git a/Sources/LanguageServerProtocol/Notifications/SetTraceNotification.swift b/Sources/LanguageServerProtocol/Notifications/SetTraceNotification.swift index 0f49bddd3..46f68dda0 100644 --- a/Sources/LanguageServerProtocol/Notifications/SetTraceNotification.swift +++ b/Sources/LanguageServerProtocol/Notifications/SetTraceNotification.swift @@ -11,7 +11,7 @@ //===----------------------------------------------------------------------===// /// A notification that should be used by the client to modify the trace setting of the server. -public struct SetTraceNotification: NotificationType, Hashable, Codable { +public struct SetTraceNotification: LSPNotification, Hashable, Codable { public static let method: String = "$/setTrace" /// The new value that should be assigned to the trace setting. diff --git a/Sources/LanguageServerProtocol/Notifications/ShowMessageNotification.swift b/Sources/LanguageServerProtocol/Notifications/ShowMessageNotification.swift index 8c6b58c08..7aced8c5e 100644 --- a/Sources/LanguageServerProtocol/Notifications/ShowMessageNotification.swift +++ b/Sources/LanguageServerProtocol/Notifications/ShowMessageNotification.swift @@ -15,7 +15,7 @@ /// - Parameters: /// - type: The kind of message. /// - message: The contents of the message. -public struct ShowMessageNotification: NotificationType, Hashable { +public struct ShowMessageNotification: LSPNotification, Hashable { public static let method: String = "window/showMessage" /// The kind of message. diff --git a/Sources/LanguageServerProtocol/Notifications/TextSynchronizationNotifications.swift b/Sources/LanguageServerProtocol/Notifications/TextSynchronizationNotifications.swift index b5917aaa5..227e709f4 100644 --- a/Sources/LanguageServerProtocol/Notifications/TextSynchronizationNotifications.swift +++ b/Sources/LanguageServerProtocol/Notifications/TextSynchronizationNotifications.swift @@ -26,7 +26,7 @@ /// capability. /// /// - Parameter textDocument: The document identifier and initial contents. -public struct DidOpenTextDocumentNotification: NotificationType, Hashable { +public struct DidOpenTextDocumentNotification: LSPNotification, Hashable { public static let method: String = "textDocument/didOpen" /// The document identifier and initial contents. @@ -44,7 +44,7 @@ public struct DidOpenTextDocumentNotification: NotificationType, Hashable { /// management of the document contents to disk, if appropriate. /// /// - Parameter textDocument: The document to close, which must be currently open. -public struct DidCloseTextDocumentNotification: NotificationType, Hashable { +public struct DidCloseTextDocumentNotification: LSPNotification, Hashable { public static let method: String = "textDocument/didClose" /// The document to close, which must be currently open. @@ -65,7 +65,7 @@ public struct DidCloseTextDocumentNotification: NotificationType, Hashable { /// - Parameters: /// - textDocument: The document to change and its current version identifier. /// - contentChanges: Edits to the document. -public struct DidChangeTextDocumentNotification: NotificationType, Hashable { +public struct DidChangeTextDocumentNotification: LSPNotification, Hashable { public static let method: String = "textDocument/didChange" /// The document that did change. The version number points @@ -151,7 +151,7 @@ public struct DidSaveTextDocumentNotification: TextDocumentNotification, Hashabl } /// The open notification is sent from the client to the server when a notebook document is opened. It is only sent by a client if the server requested the synchronization mode `notebook` in its `notebookDocumentSync` capability. -public struct DidOpenNotebookDocumentNotification: NotificationType, Hashable { +public struct DidOpenNotebookDocumentNotification: LSPNotification, Hashable { public static let method: String = "notebookDocument/didOpen" /// The notebook document that got opened. @@ -168,7 +168,7 @@ public struct DidOpenNotebookDocumentNotification: NotificationType, Hashable { } /// The change notification is sent from the client to the server when a notebook document changes. It is only sent by a client if the server requested the synchronization mode `notebook` in its `notebookDocumentSync` capability. -public struct DidChangeNotebookDocumentNotification: NotificationType, Hashable { +public struct DidChangeNotebookDocumentNotification: LSPNotification, Hashable { public static let method: String = "notebookDocument/didChange" /// The notebook document that did change. The version number points @@ -195,7 +195,7 @@ public struct DidChangeNotebookDocumentNotification: NotificationType, Hashable } /// The save notification is sent from the client to the server when a notebook document is saved. It is only sent by a client if the server requested the synchronization mode `notebook` in its `notebookDocumentSync` capability. -public struct DidSaveNotebookDocumentNotification: NotificationType { +public struct DidSaveNotebookDocumentNotification: LSPNotification { public static let method: String = "notebookDocument/didSave" /// The notebook document that got saved. @@ -207,7 +207,7 @@ public struct DidSaveNotebookDocumentNotification: NotificationType { } /// The close notification is sent from the client to the server when a notebook document is closed. It is only sent by a client if the server requested the synchronization mode `notebook` in its `notebookDocumentSync` capability. -public struct DidCloseNotebookDocumentNotification: NotificationType { +public struct DidCloseNotebookDocumentNotification: LSPNotification { public static let method: String = "notebookDocument/didClose" /// The notebook document that got closed. diff --git a/Sources/LanguageServerProtocol/Notifications/WorkDoneProgress.swift b/Sources/LanguageServerProtocol/Notifications/WorkDoneProgress.swift index 3bfeb254a..c8ae9c297 100644 --- a/Sources/LanguageServerProtocol/Notifications/WorkDoneProgress.swift +++ b/Sources/LanguageServerProtocol/Notifications/WorkDoneProgress.swift @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -public struct WorkDoneProgress: NotificationType, Hashable { +public struct WorkDoneProgress: LSPNotification, Hashable { public static let method: String = "$/progress" /// The progress token provided by the client or server. diff --git a/Sources/LanguageServerProtocol/Requests/ApplyEditRequest.swift b/Sources/LanguageServerProtocol/Requests/ApplyEditRequest.swift index f39c22b8e..0619be8cb 100644 --- a/Sources/LanguageServerProtocol/Requests/ApplyEditRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/ApplyEditRequest.swift @@ -15,7 +15,7 @@ /// - Parameters: /// - label: An optional label of the workspace edit. /// - edit: The edits to apply. -public struct ApplyEditRequest: RequestType { +public struct ApplyEditRequest: LSPRequest { public static let method: String = "workspace/applyEdit" public typealias Response = ApplyEditResponse diff --git a/Sources/LanguageServerProtocol/Requests/CallHierarchyIncomingCallsRequest.swift b/Sources/LanguageServerProtocol/Requests/CallHierarchyIncomingCallsRequest.swift index 0c2946342..58aa27da4 100644 --- a/Sources/LanguageServerProtocol/Requests/CallHierarchyIncomingCallsRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/CallHierarchyIncomingCallsRequest.swift @@ -13,7 +13,7 @@ /// The request is sent from the client to the server to resolve the callers for /// a given call hierarchy item. It is only issued if a server registers for the /// `textDocument/prepareCallHierarchy` request. -public struct CallHierarchyIncomingCallsRequest: RequestType { +public struct CallHierarchyIncomingCallsRequest: LSPRequest { public static let method: String = "callHierarchy/incomingCalls" public typealias Response = [CallHierarchyIncomingCall]? diff --git a/Sources/LanguageServerProtocol/Requests/CallHierarchyOutgoingCallsRequest.swift b/Sources/LanguageServerProtocol/Requests/CallHierarchyOutgoingCallsRequest.swift index 744be46b3..388d45ac1 100644 --- a/Sources/LanguageServerProtocol/Requests/CallHierarchyOutgoingCallsRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/CallHierarchyOutgoingCallsRequest.swift @@ -12,7 +12,7 @@ /// The request is sent from the client to the server to resolve callees for a given call hierarchy item. /// It is only issued if a server registers for the `textDocument/prepareCallHierarchy` request. -public struct CallHierarchyOutgoingCallsRequest: RequestType { +public struct CallHierarchyOutgoingCallsRequest: LSPRequest { public static let method: String = "callHierarchy/outgoingCalls" public typealias Response = [CallHierarchyOutgoingCall]? diff --git a/Sources/LanguageServerProtocol/Requests/CodeActionResolveRequest.swift b/Sources/LanguageServerProtocol/Requests/CodeActionResolveRequest.swift index a4197b843..d23fc4775 100644 --- a/Sources/LanguageServerProtocol/Requests/CodeActionResolveRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/CodeActionResolveRequest.swift @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -public struct CodeActionResolveRequest: RequestType { +public struct CodeActionResolveRequest: LSPRequest { public static let method: String = "codeAction/resolve" public typealias Response = CodeAction diff --git a/Sources/LanguageServerProtocol/Requests/CodeLensRefreshRequest.swift b/Sources/LanguageServerProtocol/Requests/CodeLensRefreshRequest.swift index 41f65a133..27c403856 100644 --- a/Sources/LanguageServerProtocol/Requests/CodeLensRefreshRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/CodeLensRefreshRequest.swift @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -public struct CodeLensRefreshRequest: RequestType { +public struct CodeLensRefreshRequest: LSPRequest { public static let method: String = "workspace/codeLens/refresh" public typealias Response = VoidResponse diff --git a/Sources/LanguageServerProtocol/Requests/CodeLensResolveRequest.swift b/Sources/LanguageServerProtocol/Requests/CodeLensResolveRequest.swift index b33db9e51..76f3df0ad 100644 --- a/Sources/LanguageServerProtocol/Requests/CodeLensResolveRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/CodeLensResolveRequest.swift @@ -11,7 +11,7 @@ //===----------------------------------------------------------------------===// /// The code lens resolve request is sent from the client to the server to resolve the command for a given code lens item. -public struct CodeLensResolveRequest: RequestType { +public struct CodeLensResolveRequest: LSPRequest { public static let method: String = "codeLens/resolve" public typealias Response = CodeLens diff --git a/Sources/LanguageServerProtocol/Requests/CompletionItemResolveRequest.swift b/Sources/LanguageServerProtocol/Requests/CompletionItemResolveRequest.swift index 8c3a317bf..b5e55f00a 100644 --- a/Sources/LanguageServerProtocol/Requests/CompletionItemResolveRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/CompletionItemResolveRequest.swift @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -public struct CompletionItemResolveRequest: RequestType { +public struct CompletionItemResolveRequest: LSPRequest { public static let method: String = "completionItem/resolve" public typealias Response = CompletionItem diff --git a/Sources/LanguageServerProtocol/Requests/CreateWorkDoneProgressRequest.swift b/Sources/LanguageServerProtocol/Requests/CreateWorkDoneProgressRequest.swift index 397bb5290..b68532a2e 100644 --- a/Sources/LanguageServerProtocol/Requests/CreateWorkDoneProgressRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/CreateWorkDoneProgressRequest.swift @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -public struct CreateWorkDoneProgressRequest: RequestType { +public struct CreateWorkDoneProgressRequest: LSPRequest { public static let method: String = "window/workDoneProgress/create" public typealias Response = VoidResponse diff --git a/Sources/LanguageServerProtocol/Requests/DiagnosticsRefreshRequest.swift b/Sources/LanguageServerProtocol/Requests/DiagnosticsRefreshRequest.swift index 1ee6da3a9..cb8dbe469 100644 --- a/Sources/LanguageServerProtocol/Requests/DiagnosticsRefreshRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/DiagnosticsRefreshRequest.swift @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -public struct DiagnosticsRefreshRequest: RequestType { +public struct DiagnosticsRefreshRequest: LSPRequest { public static let method: String = "workspace/diagnostic/refresh" public typealias Response = VoidResponse diff --git a/Sources/LanguageServerProtocol/Requests/DocumentLinkResolveRequest.swift b/Sources/LanguageServerProtocol/Requests/DocumentLinkResolveRequest.swift index fc88fb1d3..b714156e6 100644 --- a/Sources/LanguageServerProtocol/Requests/DocumentLinkResolveRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/DocumentLinkResolveRequest.swift @@ -11,7 +11,7 @@ //===----------------------------------------------------------------------===// /// The document links request is sent from the client to the server to request the location of links in a document. -public struct DocumentLinkResolveRequest: RequestType { +public struct DocumentLinkResolveRequest: LSPRequest { public static let method: String = "documentLink/resolve" public typealias Response = DocumentLink diff --git a/Sources/LanguageServerProtocol/Requests/ExecuteCommandRequest.swift b/Sources/LanguageServerProtocol/Requests/ExecuteCommandRequest.swift index efbe44ea6..9b805c5c4 100644 --- a/Sources/LanguageServerProtocol/Requests/ExecuteCommandRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/ExecuteCommandRequest.swift @@ -21,7 +21,7 @@ /// - Parameters: /// - command: The command to be executed. /// - arguments: The arguments to use when executing the command. -public struct ExecuteCommandRequest: RequestType { +public struct ExecuteCommandRequest: LSPRequest { public static let method: String = "workspace/executeCommand" public typealias Response = LSPAny? diff --git a/Sources/LanguageServerProtocol/Requests/GetReferenceDocumentRequest.swift b/Sources/LanguageServerProtocol/Requests/GetReferenceDocumentRequest.swift index eb3a233f1..646c59113 100644 --- a/Sources/LanguageServerProtocol/Requests/GetReferenceDocumentRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/GetReferenceDocumentRequest.swift @@ -23,7 +23,7 @@ /// This request is an extension to LSP supported by SourceKit-LSP. /// Enable the experimental client capability `"workspace/getReferenceDocument"` so that the server responds with /// reference document URLs for certain requests or commands whenever possible. -public struct GetReferenceDocumentRequest: RequestType { +public struct GetReferenceDocumentRequest: LSPRequest { public static let method: String = "workspace/getReferenceDocument" public typealias Response = GetReferenceDocumentResponse diff --git a/Sources/LanguageServerProtocol/Requests/InitializeRequest.swift b/Sources/LanguageServerProtocol/Requests/InitializeRequest.swift index 226cf2e21..694b935ea 100644 --- a/Sources/LanguageServerProtocol/Requests/InitializeRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/InitializeRequest.swift @@ -27,7 +27,7 @@ /// folders. /// /// - Returns: -public struct InitializeRequest: RequestType, Hashable { +public struct InitializeRequest: LSPRequest, Hashable { /// Information about the client public struct ClientInfo: Codable, Hashable, Sendable { // The name of the client as defined by the client. diff --git a/Sources/LanguageServerProtocol/Requests/InlayHintRefreshRequest.swift b/Sources/LanguageServerProtocol/Requests/InlayHintRefreshRequest.swift index b76261b83..9b4546f66 100644 --- a/Sources/LanguageServerProtocol/Requests/InlayHintRefreshRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/InlayHintRefreshRequest.swift @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -public struct InlayHintRefreshRequest: RequestType { +public struct InlayHintRefreshRequest: LSPRequest { public static let method: String = "workspace/inlayHint/refresh" public typealias Response = VoidResponse diff --git a/Sources/LanguageServerProtocol/Requests/InlayHintResolveRequest.swift b/Sources/LanguageServerProtocol/Requests/InlayHintResolveRequest.swift index 7646eeb25..9867c546e 100644 --- a/Sources/LanguageServerProtocol/Requests/InlayHintResolveRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/InlayHintResolveRequest.swift @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -public struct InlayHintResolveRequest: RequestType { +public struct InlayHintResolveRequest: LSPRequest { public static let method: String = "inlayHint/resolve" public typealias Response = InlayHint diff --git a/Sources/LanguageServerProtocol/Requests/InlineValueRefreshRequest.swift b/Sources/LanguageServerProtocol/Requests/InlineValueRefreshRequest.swift index b479a1724..48d4b748c 100644 --- a/Sources/LanguageServerProtocol/Requests/InlineValueRefreshRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/InlineValueRefreshRequest.swift @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -public struct InlineValueRefreshRequest: RequestType { +public struct InlineValueRefreshRequest: LSPRequest { public static let method: String = "workspace/inlineValue/refresh" public typealias Response = VoidResponse diff --git a/Sources/LanguageServerProtocol/Requests/IsIndexingRequest.swift b/Sources/LanguageServerProtocol/Requests/IsIndexingRequest.swift index ca4739189..8666d5e3f 100644 --- a/Sources/LanguageServerProtocol/Requests/IsIndexingRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/IsIndexingRequest.swift @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -public struct IsIndexingRequest: RequestType { +public struct IsIndexingRequest: LSPRequest { public static let method: String = "sourceKit/_isIndexing" public typealias Response = IsIndexingResponse diff --git a/Sources/LanguageServerProtocol/Requests/OutputPathsRequest.swift b/Sources/LanguageServerProtocol/Requests/OutputPathsRequest.swift index d7e498c32..f6fed3189 100644 --- a/Sources/LanguageServerProtocol/Requests/OutputPathsRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/OutputPathsRequest.swift @@ -14,7 +14,7 @@ /// BSP request). /// /// **(LSP Extension)**. -public struct OutputPathsRequest: RequestType, Hashable { +public struct OutputPathsRequest: LSPRequest, Hashable { public static let method: String = "workspace/_outputPaths" public typealias Response = OutputPathsResponse diff --git a/Sources/LanguageServerProtocol/Requests/PeekDocumentsRequest.swift b/Sources/LanguageServerProtocol/Requests/PeekDocumentsRequest.swift index 7303934ff..cc586b50e 100644 --- a/Sources/LanguageServerProtocol/Requests/PeekDocumentsRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/PeekDocumentsRequest.swift @@ -28,7 +28,7 @@ /// This request is an extension to LSP supported by SourceKit-LSP. /// It requires the experimental client capability `"workspace/peekDocuments"` to use. /// It also needs the client to handle the request and present the "peeked" editor. -public struct PeekDocumentsRequest: RequestType { +public struct PeekDocumentsRequest: LSPRequest { public static let method: String = "workspace/peekDocuments" public typealias Response = PeekDocumentsResponse diff --git a/Sources/LanguageServerProtocol/Requests/RegisterCapabilityRequest.swift b/Sources/LanguageServerProtocol/Requests/RegisterCapabilityRequest.swift index 9d80fb305..3e67827cf 100644 --- a/Sources/LanguageServerProtocol/Requests/RegisterCapabilityRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/RegisterCapabilityRequest.swift @@ -22,7 +22,7 @@ import Foundation /// and dynamically. Servers that want to support both should check the client capabilities and only /// register the capability statically if the client doesn't support dynamic registration for that /// capability. -public struct RegisterCapabilityRequest: RequestType, Hashable { +public struct RegisterCapabilityRequest: LSPRequest, Hashable { public static let method: String = "client/registerCapability" public typealias Response = VoidResponse diff --git a/Sources/LanguageServerProtocol/Requests/SetOptionsRequest.swift b/Sources/LanguageServerProtocol/Requests/SetOptionsRequest.swift index aa59284d4..395fe3a8a 100644 --- a/Sources/LanguageServerProtocol/Requests/SetOptionsRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/SetOptionsRequest.swift @@ -13,7 +13,7 @@ /// New request to modify runtime options of SourceKit-LSP. // /// Any options not specified in this request will be left as-is. -public struct SetOptionsRequest: RequestType { +public struct SetOptionsRequest: LSPRequest { public static let method: String = "workspace/_setOptions" public typealias Response = VoidResponse diff --git a/Sources/LanguageServerProtocol/Requests/ShowDocumentRequest.swift b/Sources/LanguageServerProtocol/Requests/ShowDocumentRequest.swift index c40139ed9..956cef3d2 100644 --- a/Sources/LanguageServerProtocol/Requests/ShowDocumentRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/ShowDocumentRequest.swift @@ -12,7 +12,7 @@ /// Request from the server to the client to show a document on the client /// side. -public struct ShowDocumentRequest: RequestType { +public struct ShowDocumentRequest: LSPRequest { public static let method: String = "window/showDocument" public typealias Response = ShowDocumentResponse diff --git a/Sources/LanguageServerProtocol/Requests/ShowMessageRequest.swift b/Sources/LanguageServerProtocol/Requests/ShowMessageRequest.swift index 3b7334d46..d5aaeab28 100644 --- a/Sources/LanguageServerProtocol/Requests/ShowMessageRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/ShowMessageRequest.swift @@ -18,7 +18,7 @@ /// - actions: Action items which the user may select (up to 1). /// /// - Returns: The action selected by the user, if any. -public struct ShowMessageRequest: RequestType, Hashable { +public struct ShowMessageRequest: LSPRequest, Hashable { public static let method: String = "window/showMessageRequest" public typealias Response = MessageActionItem? diff --git a/Sources/LanguageServerProtocol/Requests/ShutdownRequest.swift b/Sources/LanguageServerProtocol/Requests/ShutdownRequest.swift index 036aa020f..a334d78f7 100644 --- a/Sources/LanguageServerProtocol/Requests/ShutdownRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/ShutdownRequest.swift @@ -16,7 +16,7 @@ /// not reach the client). See `Exit`. /// /// - Returns: Void. -public struct ShutdownRequest: RequestType, Hashable { +public struct ShutdownRequest: LSPRequest, Hashable { public static let method: String = "shutdown" public struct Response: ResponseType, Equatable { diff --git a/Sources/LanguageServerProtocol/Requests/SourceKitOptionsRequest.swift b/Sources/LanguageServerProtocol/Requests/SourceKitOptionsRequest.swift index ef0052d05..17f5f1841 100644 --- a/Sources/LanguageServerProtocol/Requests/SourceKitOptionsRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/SourceKitOptionsRequest.swift @@ -17,7 +17,7 @@ /// instead of the `textDocument/` prefix. /// /// **(LSP Extension)**. -public struct SourceKitOptionsRequest: RequestType, Hashable { +public struct SourceKitOptionsRequest: LSPRequest, Hashable { public static let method: String = "workspace/_sourceKitOptions" public typealias Response = SourceKitOptionsResponse diff --git a/Sources/LanguageServerProtocol/Requests/SynchronizeRequest.swift b/Sources/LanguageServerProtocol/Requests/SynchronizeRequest.swift index 33ba049bb..cd7b66d59 100644 --- a/Sources/LanguageServerProtocol/Requests/SynchronizeRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/SynchronizeRequest.swift @@ -26,7 +26,7 @@ /// is ill-suited for any kind of interactive environment. In those environments, it is preferable to quickly give the /// user a result based on the data that is available and (let the user) re-perform the action if the underlying index /// data has changed. -public struct SynchronizeRequest: RequestType { +public struct SynchronizeRequest: LSPRequest { public static let method: String = "workspace/synchronize" public typealias Response = VoidResponse diff --git a/Sources/LanguageServerProtocol/Requests/TriggerReindexRequest.swift b/Sources/LanguageServerProtocol/Requests/TriggerReindexRequest.swift index 9f99614db..e1baf6283 100644 --- a/Sources/LanguageServerProtocol/Requests/TriggerReindexRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/TriggerReindexRequest.swift @@ -17,7 +17,7 @@ /// a workaround to re-index files when such a bug occurs where otherwise there would be no workaround. /// /// **LSP Extension** -public struct TriggerReindexRequest: RequestType { +public struct TriggerReindexRequest: LSPRequest { public static let method: String = "workspace/triggerReindex" public typealias Response = VoidResponse diff --git a/Sources/LanguageServerProtocol/Requests/TypeHierarchySubtypesRequest.swift b/Sources/LanguageServerProtocol/Requests/TypeHierarchySubtypesRequest.swift index a53305bca..534b66d1d 100644 --- a/Sources/LanguageServerProtocol/Requests/TypeHierarchySubtypesRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/TypeHierarchySubtypesRequest.swift @@ -13,7 +13,7 @@ /// The request is sent from the client to the server to resolve the subtypes for /// a given call hierarchy item. It is only issued if a server registers for the /// `textDocument/prepareTypeHierarchy` request. -public struct TypeHierarchySubtypesRequest: RequestType { +public struct TypeHierarchySubtypesRequest: LSPRequest { public static let method: String = "typeHierarchy/subtypes" public typealias Response = [TypeHierarchyItem]? diff --git a/Sources/LanguageServerProtocol/Requests/TypeHierarchySupertypesRequest.swift b/Sources/LanguageServerProtocol/Requests/TypeHierarchySupertypesRequest.swift index 9239a914d..629cd824b 100644 --- a/Sources/LanguageServerProtocol/Requests/TypeHierarchySupertypesRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/TypeHierarchySupertypesRequest.swift @@ -13,7 +13,7 @@ /// The request is sent from the client to the server to resolve the supertypes for /// a given call hierarchy item. It is only issued if a server registers for the /// `textDocument/prepareTypeHierarchy` request. -public struct TypeHierarchySupertypesRequest: RequestType { +public struct TypeHierarchySupertypesRequest: LSPRequest { public static let method: String = "typeHierarchy/supertypes" public typealias Response = [TypeHierarchyItem]? diff --git a/Sources/LanguageServerProtocol/Requests/UnregisterCapabilityRequest.swift b/Sources/LanguageServerProtocol/Requests/UnregisterCapabilityRequest.swift index 078284e02..d29d6ee4b 100644 --- a/Sources/LanguageServerProtocol/Requests/UnregisterCapabilityRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/UnregisterCapabilityRequest.swift @@ -12,7 +12,7 @@ /// Request sent from the server to the client to unregister a previously registered /// capability. -public struct UnregisterCapabilityRequest: RequestType, Hashable { +public struct UnregisterCapabilityRequest: LSPRequest, Hashable { public static let method: String = "client/unregisterCapability" public typealias Response = VoidResponse diff --git a/Sources/LanguageServerProtocol/Requests/WillChangeFilesRequests.swift b/Sources/LanguageServerProtocol/Requests/WillChangeFilesRequests.swift index b2bd19f1a..4d8e0845b 100644 --- a/Sources/LanguageServerProtocol/Requests/WillChangeFilesRequests.swift +++ b/Sources/LanguageServerProtocol/Requests/WillChangeFilesRequests.swift @@ -20,7 +20,7 @@ public struct FileCreate: Codable, Hashable, Sendable { } } -public struct WillCreateFilesRequest: RequestType { +public struct WillCreateFilesRequest: LSPRequest { public static let method: String = "workspace/willCreateFiles" public typealias Response = WorkspaceEdit? @@ -47,7 +47,7 @@ public struct FileRename: Codable, Hashable, Sendable { } } -public struct WillRenameFilesRequest: RequestType { +public struct WillRenameFilesRequest: LSPRequest { public static let method: String = "workspace/willRenameFiles" public typealias Response = WorkspaceEdit? @@ -70,7 +70,7 @@ public struct FileDelete: Codable, Hashable, Sendable { } } -public struct WillDeleteFilesRequest: RequestType { +public struct WillDeleteFilesRequest: LSPRequest { public static let method: String = "workspace/willDeleteFiles" public typealias Response = WorkspaceEdit? diff --git a/Sources/LanguageServerProtocol/Requests/WorkspaceDiagnosticsRequest.swift b/Sources/LanguageServerProtocol/Requests/WorkspaceDiagnosticsRequest.swift index 863398ef7..7abc34134 100644 --- a/Sources/LanguageServerProtocol/Requests/WorkspaceDiagnosticsRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/WorkspaceDiagnosticsRequest.swift @@ -24,7 +24,7 @@ public struct PreviousResultId: Codable, Sendable { } } -public struct WorkspaceDiagnosticsRequest: RequestType { +public struct WorkspaceDiagnosticsRequest: LSPRequest { public static let method: String = "workspace/diagnostic" public typealias Response = WorkspaceDiagnosticReport diff --git a/Sources/LanguageServerProtocol/Requests/WorkspaceFoldersRequest.swift b/Sources/LanguageServerProtocol/Requests/WorkspaceFoldersRequest.swift index c3ea079b2..05a9c3ceb 100644 --- a/Sources/LanguageServerProtocol/Requests/WorkspaceFoldersRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/WorkspaceFoldersRequest.swift @@ -17,7 +17,7 @@ /// /// - Returns: The set of currently open workspace folders. Returns nil if only a single file is /// open. Returns an empty array if a workspace is open but no folders are configured. -public struct WorkspaceFoldersRequest: RequestType, Hashable { +public struct WorkspaceFoldersRequest: LSPRequest, Hashable { public static let method: String = "workspace/workspaceFolders" public typealias Response = [WorkspaceFolder]? diff --git a/Sources/LanguageServerProtocol/Requests/WorkspaceSemanticTokensRefreshRequest.swift b/Sources/LanguageServerProtocol/Requests/WorkspaceSemanticTokensRefreshRequest.swift index b5b3d280f..e62329e71 100644 --- a/Sources/LanguageServerProtocol/Requests/WorkspaceSemanticTokensRefreshRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/WorkspaceSemanticTokensRefreshRequest.swift @@ -13,7 +13,7 @@ /// Sent from the server to the client. Servers can use this to ask clients to /// refresh semantic tokens for editors for which this server provides semantic /// tokens, useful in cases of project wide configuration changes. -public struct WorkspaceSemanticTokensRefreshRequest: RequestType, Hashable { +public struct WorkspaceSemanticTokensRefreshRequest: LSPRequest, Hashable { public static let method: String = "workspace/semanticTokens/refresh" public typealias Response = VoidResponse diff --git a/Sources/LanguageServerProtocol/Requests/WorkspaceSymbolResolveRequest.swift b/Sources/LanguageServerProtocol/Requests/WorkspaceSymbolResolveRequest.swift index fd0b3be2b..fb6259b79 100644 --- a/Sources/LanguageServerProtocol/Requests/WorkspaceSymbolResolveRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/WorkspaceSymbolResolveRequest.swift @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -public struct WorkspaceSymbolResolveRequest: RequestType { +public struct WorkspaceSymbolResolveRequest: LSPRequest { public static let method: String = "workspaceSymbol/resolve" public typealias Response = WorkspaceSymbol diff --git a/Sources/LanguageServerProtocol/Requests/WorkspaceSymbolsRequest.swift b/Sources/LanguageServerProtocol/Requests/WorkspaceSymbolsRequest.swift index 5c8dc1368..27543fc9b 100644 --- a/Sources/LanguageServerProtocol/Requests/WorkspaceSymbolsRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/WorkspaceSymbolsRequest.swift @@ -21,7 +21,7 @@ /// - query: The string that should be looked for in symbols of the workspace. /// /// - Returns: Information about each symbol with a name that contains the query string -public struct WorkspaceSymbolsRequest: RequestType, Hashable { +public struct WorkspaceSymbolsRequest: LSPRequest, Hashable { public static let method: String = "workspace/symbol" public typealias Response = [WorkspaceSymbolItem]? diff --git a/Sources/LanguageServerProtocol/Requests/WorkspaceTestsRequest.swift b/Sources/LanguageServerProtocol/Requests/WorkspaceTestsRequest.swift index 843b645ef..a760b682c 100644 --- a/Sources/LanguageServerProtocol/Requests/WorkspaceTestsRequest.swift +++ b/Sources/LanguageServerProtocol/Requests/WorkspaceTestsRequest.swift @@ -13,7 +13,7 @@ /// A request that returns symbols for all the test classes and test methods within the current workspace. /// /// **(LSP Extension)** -public struct WorkspaceTestsRequest: RequestType, Hashable { +public struct WorkspaceTestsRequest: LSPRequest, Hashable { public static let method: String = "workspace/tests" public typealias Response = [TestItem]