Skip to content

Commit 0097a84

Browse files
authored
Merge pull request #215 from ahoppen/shutdown-request
Rename Shutdown to ShutdownRequest
2 parents f19ee68 + ce5f477 commit 0097a84

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

Sources/LanguageServerProtocol/Messages.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
/// `MessageRegistry._register()` which allows you to avoid bloating the real server implementation.
1818
public let builtinRequests: [_RequestType.Type] = [
1919
InitializeRequest.self,
20-
Shutdown.self,
20+
ShutdownRequest.self,
2121
WorkspaceFoldersRequest.self,
2222
CompletionRequest.self,
2323
HoverRequest.self,

Sources/LanguageServerProtocol/Requests/ShutdownRequest.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@
1616
/// not reach the client). See `Exit`.
1717
///
1818
/// - Returns: Void.
19-
public struct Shutdown: RequestType, Hashable {
19+
public struct ShutdownRequest: RequestType, Hashable {
2020
public static let method: String = "shutdown"
2121
public typealias Response = VoidResponse
2222

2323
public init() { }
2424
}
25+
26+
@available(*, deprecated, renamed: "ShutdownRequest")
27+
public typealias Shutdown = ShutdownRequest

Sources/SourceKit/SourceKitServer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ extension SourceKitServer {
378378
}
379379

380380

381-
func shutdown(_ request: Request<Shutdown>) {
381+
func shutdown(_ request: Request<ShutdownRequest>) {
382382
_prepareForExit()
383383
request.reply(VoidResponse())
384384
}

Sources/SourceKit/sourcekitd/SwiftLanguageServer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ extension SwiftLanguageServer {
168168
// Nothing to do.
169169
}
170170

171-
func shutdown(_ request: Request<Shutdown>) {
171+
func shutdown(_ request: Request<ShutdownRequest>) {
172172
api.set_notification_handler(nil)
173173
}
174174

Tests/SourceKitTests/SourceKitTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ final class SKTests: XCTestCase {
136136
XCTAssertEqual(versionContentsBefore.count, 1)
137137
XCTAssert(versionContentsBefore.first?.lastPathComponent.starts(with: "p") ?? false)
138138

139-
_ = try ws.sk.sendSync(Shutdown())
139+
_ = try ws.sk.sendSync(ShutdownRequest())
140140
return versionedPath
141141
}
142142

0 commit comments

Comments
 (0)