diff --git a/Package.resolved b/Package.resolved index fd4ca5f..0f4ea11 100644 --- a/Package.resolved +++ b/Package.resolved @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/ChimeHQ/LanguageServerProtocol", "state" : { - "revision" : "9ae95d89b1a3f2c5da98adea29637c519a7e3c6c", - "version" : "0.12.0" + "revision" : "f5a53e0386b34a0e06333ec9376f5972f7d20c28", + "version" : "0.13.0" } }, { diff --git a/Package.swift b/Package.swift index 6e5111b..3ca57c6 100644 --- a/Package.swift +++ b/Package.swift @@ -15,7 +15,7 @@ let package = Package( targets: ["LanguageClient"]), ], dependencies: [ - .package(url: "https://github.com/ChimeHQ/LanguageServerProtocol", from: "0.12.0"), + .package(url: "https://github.com/ChimeHQ/LanguageServerProtocol", from: "0.13.0"), .package(url: "https://github.com/Frizlab/FSEventsWrapper", from: "2.1.0"), .package(url: "https://github.com/ChimeHQ/GlobPattern", from: "0.1.1"), .package(url: "https://github.com/ChimeHQ/JSONRPC", from: "0.9.0"), diff --git a/README.md b/README.md index 68e9da5..bd4c0f1 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ let channel = try DataChannel.localProcessChannel( terminationHandler: { print("terminated") } ) -// finally, make a server you can interact with +// finally, make a server you can interact with let server = JSONRPCServerConnection(dataChannel: channel) ``` @@ -67,7 +67,6 @@ let server = JSONRPCServerConnection(dataChannel: channel) ```swift import LanguageClient import LanguageServerProtocol -import LSPClient import Foundation let executionParams = Process.ExecutionParameters( @@ -93,7 +92,7 @@ let provider: InitializingServer.InitializeParamsProvider = { window: nil, general: nil, experimental: nil) - + // pay careful attention to rootPath/rootURI/workspaceFolders, as different servers will // have different expectations/requirements here return InitializeParams(processId: Int(ProcessInfo.processInfo.processIdentifier), @@ -110,18 +109,18 @@ let server = InitializingServer(server: localServer, initializeParamsProvider: p Task { let docContent = try String(contentsOf: docURL) - + let doc = TextDocumentItem( uri: docURL.absoluteString, languageId: .swift, version: 1, text: docContent ) - + let docParams = DidOpenTextDocumentParams(textDocument: doc) - + try await server.textDocumentDidOpen(params: docParams) - + // make sure to pick a reasonable position within your test document let pos = Position(line: 5, character: 25) let completionParams = CompletionParams( @@ -130,9 +129,9 @@ Task { triggerKind: .invoked, triggerCharacter: nil ) - + let completions = try await server.completion(params: completionParams) - + print("completions: ", completions) } ``` diff --git a/Sources/LanguageClient/InitializingServer.swift b/Sources/LanguageClient/InitializingServer.swift index 9aa063e..4c736ab 100644 --- a/Sources/LanguageClient/InitializingServer.swift +++ b/Sources/LanguageClient/InitializingServer.swift @@ -170,10 +170,10 @@ extension InitializingServer { let params = try await initializeParamsProvider() - let initResponse = try await channel.initialize(params: params) + let initResponse = try await channel.initialize(params) let caps = initResponse.capabilities - try await channel.initialized(params: InitializedParams()) + try await channel.initialized(InitializedParams()) self.state = .initialized(caps) diff --git a/Sources/LanguageClient/RestartingServer.swift b/Sources/LanguageClient/RestartingServer.swift index 55d7f67..0eaf051 100644 --- a/Sources/LanguageClient/RestartingServer.swift +++ b/Sources/LanguageClient/RestartingServer.swift @@ -126,7 +126,7 @@ public actor RestartingServer { let params = DidOpenTextDocumentParams(textDocument: item) - try await server.textDocumentDidOpen(params: params) + try await server.textDocumentDidOpen(params) } catch { #if canImport(OSLog) logger.error("Failed to reopen document \(uri, privacy: .public): \(error, privacy: .public)") diff --git a/Tests/LanguageClientTests/ServerTests.swift b/Tests/LanguageClientTests/ServerTests.swift index 1869223..96139bc 100644 --- a/Tests/LanguageClientTests/ServerTests.swift +++ b/Tests/LanguageClientTests/ServerTests.swift @@ -38,7 +38,7 @@ final class ServerTests: XCTestCase { let params = TextDocumentPositionParams(uri: "abc", position: .init((0, 0))) - let response = try await server.hover(params: params) + let response = try await server.hover(params) let messages = await mockChannel.finishSession()