ChimeHQ / LanguageClient

Language Server Protocol (LSP) client for Swift
BSD 3-Clause "New" or "Revised" License
96 stars 10 forks source link

Compiler errors in installed package #11

Open voxoid0 opened 10 months ago

voxoid0 commented 10 months ago

Hello, do you know why I would get the following compile errors after installing the LanguageClient package into a new XCode CLI project?

.../SourcePackages/checkouts/LanguageServerProtocol/Sources/LanguageServerProtocol/Additions/JSONRPCServer.swift:275:84: error: 'RequestHandler' is not a member type of actor 'JSONRPC.JSONRPCSession'
        private nonisolated func makeErrorOnlyHandler(_ handler: @escaping JSONRPCSession.RequestHandler) -> ServerRequest.ErrorOnlyHandler {
                                                                           ~~~~~~~~~~~~~~ ^
.../SourcePackages/checkouts/JSONRPC/Sources/JSONRPC/JSONRPCSession.swift:46:14: note: 'JSONRPCSession' declared here
public actor JSONRPCSession {
             ^
.../SourcePackages/checkouts/LanguageServerProtocol/Sources/LanguageServerProtocol/Additions/JSONRPCServer.swift:285:78: error: 'RequestHandler' is not a member type of actor 'JSONRPC.JSONRPCSession'
        private nonisolated func makeHandler<T>(_ handler: @escaping JSONRPCSession.RequestHandler) -> ServerRequest.Handler<T> {
                                                                     ~~~~~~~~~~~~~~ ^
.../SourcePackages/checkouts/JSONRPC/Sources/JSONRPC/JSONRPCSession.swift:46:14: note: 'JSONRPCSession' declared here
public actor JSONRPCSession {
             ^
.../SourcePackages/checkouts/LanguageServerProtocol/Sources/LanguageServerProtocol/Additions/JSONRPCServer.swift:293:108: error: 'RequestHandler' is not a member type of actor 'JSONRPC.JSONRPCSession'
        private func handleRequest(_ anyRequest: AnyJSONRPCRequest, data: Data, handler: @escaping JSONRPCSession.RequestHandler) {
                                                                                                   ~~~~~~~~~~~~~~ ^
.../SourcePackages/checkouts/JSONRPC/Sources/JSONRPC/JSONRPCSession.swift:46:14: note: 'JSONRPCSession' declared here
public actor JSONRPCSession {
             ^
.../SourcePackages/checkouts/LanguageServerProtocol/Sources/LanguageServerProtocol/Additions/JSONRPCServer.swift:54:36: error: value of type 'JSONRPCSession' has no member 'notificationSequence'
                let noteSequence = await session.notificationSequence
                                         ~~~~~~~ ^~~~~~~~~~~~~~~~~~~~
.../SourcePackages/checkouts/LanguageServerProtocol/Sources/LanguageServerProtocol/Additions/JSONRPCServer.swift:66:35: error: value of type 'JSONRPCSession' has no member 'requestSequence'
                let reqSequence = await session.requestSequence
                                        ~~~~~~~ ^~~~~~~~~~~~~~~
.../SourcePackages/checkouts/LanguageServerProtocol/Sources/LanguageServerProtocol/Additions/JSONRPCServer.swift:54:22: warning: no 'async' operations occur within 'await' expression
                let noteSequence = await session.notificationSequence
                                   ^
.../SourcePackages/checkouts/LanguageServerProtocol/Sources/LanguageServerProtocol/Additions/JSONRPCServer.swift:278:20: error: cannot infer contextual base in reference to member 'failure'
                                await handler(.failure(error))
                                              ~^~~~~~~
mattmassicotte commented 10 months ago

Ack.

This is caused by using a version of JSONRPC is that is too new. The problem is being fixed for real with https://github.com/ChimeHQ/LanguageClient/pull/9.

For right now, if you explicitly add a dependency on https://github.com/ChimeHQ/JSONRPC with version 0.8.1 everything should work.