Skip to content

Commit 62271b4

Browse files
authored
Merge pull request #1734 from ahoppen/lsp-module-references
Remove references to the `LanguageServerProtocol` modules in that module itself
2 parents 01640ee + 06f6f8f commit 62271b4

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

Sources/LanguageServerProtocol/Connection.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ public final class WeakMessageHandler: MessageHandler, Sendable {
6161
self.handler = handler
6262
}
6363

64-
public func handle(_ params: some LanguageServerProtocol.NotificationType) {
64+
public func handle(_ params: some NotificationType) {
6565
handler?.handle(params)
6666
}
6767

6868
public func handle<Request: RequestType>(
6969
_ params: Request,
70-
id: LanguageServerProtocol.RequestID,
71-
reply: @Sendable @escaping (LanguageServerProtocol.LSPResult<Request.Response>) -> Void
70+
id: RequestID,
71+
reply: @Sendable @escaping (LSPResult<Request.Response>) -> Void
7272
) {
7373
guard let handler = handler else {
7474
reply(.failure(.unknown("Handler has been deallocated")))

Sources/LanguageServerProtocol/SupportTypes/ClientCapabilities.swift

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -86,26 +86,26 @@ public struct WorkspaceClientCapabilities: Hashable, Codable, Sendable {
8686
public struct Symbol: Hashable, Codable, Sendable {
8787

8888
/// Capabilities specific to `SymbolKind`.
89-
public struct SymbolKind: Hashable, Codable, Sendable {
89+
public struct SymbolKindValueSet: Hashable, Codable, Sendable {
9090

9191
/// The symbol kind values that the client can support.
9292
///
9393
/// If not specified, the client support only the kinds from `File` to `Array` from LSP 1.
9494
///
9595
/// If specified, the client *also* guarantees that it will handle unknown kinds gracefully.
96-
public var valueSet: [LanguageServerProtocol.SymbolKind]? = nil
96+
public var valueSet: [SymbolKind]? = nil
9797

98-
public init(valueSet: [LanguageServerProtocol.SymbolKind]? = nil) {
98+
public init(valueSet: [SymbolKind]? = nil) {
9999
self.valueSet = valueSet
100100
}
101101
}
102102

103103
/// Whether the client supports dynamic registration of this request.
104104
public var dynamicRegistration: Bool? = nil
105105

106-
public var symbolKind: SymbolKind? = nil
106+
public var symbolKind: SymbolKindValueSet? = nil
107107

108-
public init(dynamicRegistration: Bool? = nil, symbolKind: SymbolKind? = nil) {
108+
public init(dynamicRegistration: Bool? = nil, symbolKind: SymbolKindValueSet? = nil) {
109109
self.dynamicRegistration = dynamicRegistration
110110
self.symbolKind = symbolKind
111111
}
@@ -296,9 +296,9 @@ public struct TextDocumentClientCapabilities: Hashable, Codable, Sendable {
296296
/// If not specified, the client support only the kinds from `Text` to `Reference` from LSP 1.
297297
///
298298
/// If specified, the client *also* guarantees that it will handle unknown kinds gracefully.
299-
public var valueSet: [LanguageServerProtocol.CompletionItemKind]? = nil
299+
public var valueSet: [CompletionItemKind]? = nil
300300

301-
public init(valueSet: [LanguageServerProtocol.CompletionItemKind]? = nil) {
301+
public init(valueSet: [CompletionItemKind]? = nil) {
302302
self.valueSet = valueSet
303303
}
304304
}
@@ -390,9 +390,9 @@ public struct TextDocumentClientCapabilities: Hashable, Codable, Sendable {
390390
/// If not specified, the client support only the kinds from `File` to `Array` from LSP 1.
391391
///
392392
/// If specified, the client *also* guarantees that it will handle unknown kinds gracefully.
393-
public var valueSet: [LanguageServerProtocol.SymbolKind]? = nil
393+
public var valueSet: [SymbolKind]? = nil
394394

395-
public init(valueSet: [LanguageServerProtocol.SymbolKind]? = nil) {
395+
public init(valueSet: [SymbolKind]? = nil) {
396396
self.valueSet = valueSet
397397
}
398398
}
@@ -434,21 +434,21 @@ public struct TextDocumentClientCapabilities: Hashable, Codable, Sendable {
434434
/// Literals accepted by the client in response to a `textDocument/codeAction` request.
435435
public struct CodeActionLiteralSupport: Hashable, Codable, Sendable {
436436
/// Accepted code action kinds.
437-
public struct CodeActionKind: Hashable, Codable, Sendable {
437+
public struct CodeActionKindValueSet: Hashable, Codable, Sendable {
438438

439439
/// The code action kind values that the client can support.
440440
///
441441
/// If specified, the client *also* guarantees that it will handle unknown kinds gracefully.
442-
public var valueSet: [LanguageServerProtocol.CodeActionKind]
442+
public var valueSet: [CodeActionKind]
443443

444-
public init(valueSet: [LanguageServerProtocol.CodeActionKind]) {
444+
public init(valueSet: [CodeActionKind]) {
445445
self.valueSet = valueSet
446446
}
447447
}
448448

449-
public var codeActionKind: CodeActionKind
449+
public var codeActionKind: CodeActionKindValueSet
450450

451-
public init(codeActionKind: CodeActionKind) {
451+
public init(codeActionKind: CodeActionKindValueSet) {
452452
self.codeActionKind = codeActionKind
453453
}
454454
}

Tests/SourceKitLSPTests/CodeActionTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import XCTest
1717

1818
private typealias CodeActionCapabilities = TextDocumentClientCapabilities.CodeAction
1919
private typealias CodeActionLiteralSupport = CodeActionCapabilities.CodeActionLiteralSupport
20-
private typealias CodeActionKindCapabilities = CodeActionLiteralSupport.CodeActionKind
20+
private typealias CodeActionKindCapabilities = CodeActionLiteralSupport.CodeActionKindValueSet
2121

2222
private let clientCapabilitiesWithCodeActionSupport: ClientCapabilities = {
2323
var documentCapabilities = TextDocumentClientCapabilities()

0 commit comments

Comments
 (0)