Skip to content

Commit

Permalink
Merge pull request #1734 from ahoppen/lsp-module-references
Browse files Browse the repository at this point in the history
Remove references to the `LanguageServerProtocol` modules in that module itself
  • Loading branch information
ahoppen authored Oct 3, 2024
2 parents 01640ee + 06f6f8f commit 62271b4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions Sources/LanguageServerProtocol/Connection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ public final class WeakMessageHandler: MessageHandler, Sendable {
self.handler = handler
}

public func handle(_ params: some LanguageServerProtocol.NotificationType) {
public func handle(_ params: some NotificationType) {
handler?.handle(params)
}

public func handle<Request: RequestType>(
_ params: Request,
id: LanguageServerProtocol.RequestID,
reply: @Sendable @escaping (LanguageServerProtocol.LSPResult<Request.Response>) -> Void
id: RequestID,
reply: @Sendable @escaping (LSPResult<Request.Response>) -> Void
) {
guard let handler = handler else {
reply(.failure(.unknown("Handler has been deallocated")))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,26 +86,26 @@ public struct WorkspaceClientCapabilities: Hashable, Codable, Sendable {
public struct Symbol: Hashable, Codable, Sendable {

/// Capabilities specific to `SymbolKind`.
public struct SymbolKind: Hashable, Codable, Sendable {
public struct SymbolKindValueSet: Hashable, Codable, Sendable {

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

public init(valueSet: [LanguageServerProtocol.SymbolKind]? = nil) {
public init(valueSet: [SymbolKind]? = nil) {
self.valueSet = valueSet
}
}

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

public var symbolKind: SymbolKind? = nil
public var symbolKind: SymbolKindValueSet? = nil

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

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

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

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

public init(valueSet: [LanguageServerProtocol.CodeActionKind]) {
public init(valueSet: [CodeActionKind]) {
self.valueSet = valueSet
}
}

public var codeActionKind: CodeActionKind
public var codeActionKind: CodeActionKindValueSet

public init(codeActionKind: CodeActionKind) {
public init(codeActionKind: CodeActionKindValueSet) {
self.codeActionKind = codeActionKind
}
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/SourceKitLSPTests/CodeActionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import XCTest

private typealias CodeActionCapabilities = TextDocumentClientCapabilities.CodeAction
private typealias CodeActionLiteralSupport = CodeActionCapabilities.CodeActionLiteralSupport
private typealias CodeActionKindCapabilities = CodeActionLiteralSupport.CodeActionKind
private typealias CodeActionKindCapabilities = CodeActionLiteralSupport.CodeActionKindValueSet

private let clientCapabilitiesWithCodeActionSupport: ClientCapabilities = {
var documentCapabilities = TextDocumentClientCapabilities()
Expand Down

0 comments on commit 62271b4

Please sign in to comment.