From a802c75f4dc2d8bbb244c85cf6c9c5b40691ac26 Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Wed, 15 Jun 2022 18:34:50 +0200 Subject: [PATCH] Update neovim --- NvimServer | 2 +- .../RxPack/RxNeovimApi.generated.swift | 922 +++++++++--------- 2 files changed, 462 insertions(+), 462 deletions(-) diff --git a/NvimServer b/NvimServer index 89e2d74d..8250676b 160000 --- a/NvimServer +++ b/NvimServer @@ -1 +1 @@ -Subproject commit 89e2d74d92cd04480e657fa763326be6334c6db4 +Subproject commit 8250676b389a814cffb3babab3165e02c859c937 diff --git a/RxPack/Sources/RxPack/RxNeovimApi.generated.swift b/RxPack/Sources/RxPack/RxNeovimApi.generated.swift index 940afb4e..33319774 100644 --- a/RxPack/Sources/RxPack/RxNeovimApi.generated.swift +++ b/RxPack/Sources/RxPack/RxNeovimApi.generated.swift @@ -661,38 +661,6 @@ extension RxNeovimApi { .asCompletable() } - public func bufGetCommands( - buffer: RxNeovimApi.Buffer, - opts: Dictionary, - errWhenBlocked: Bool = true - ) -> Single> { - - let params: [RxNeovimApi.Value] = [ - .int(Int64(buffer.handle)), - .map(opts.mapToDict({ (Value.string($0), $1) })), - ] - - func transform(_ value: Value) throws -> Dictionary { - guard let result = (msgPackDictToSwift(value.dictionaryValue)) else { - throw RxNeovimApi.Error.conversion(type: Dictionary.self) - } - - return result - } - - if errWhenBlocked { - return self - .checkBlocked( - self.rpc(method: "nvim_buf_get_commands", params: params, expectsReturnValue: true) - ) - .map(transform) - } - - return self - .rpc(method: "nvim_buf_get_commands", params: params, expectsReturnValue: true) - .map(transform) - } - public func bufSetVar( buffer: RxNeovimApi.Buffer, name: String, @@ -743,64 +711,6 @@ extension RxNeovimApi { .asCompletable() } - public func bufGetOption( - buffer: RxNeovimApi.Buffer, - name: String, - errWhenBlocked: Bool = true - ) -> Single { - - let params: [RxNeovimApi.Value] = [ - .int(Int64(buffer.handle)), - .string(name), - ] - - func transform(_ value: Value) throws -> RxNeovimApi.Value { - guard let result = (Optional(value)) else { - throw RxNeovimApi.Error.conversion(type: RxNeovimApi.Value.self) - } - - return result - } - - if errWhenBlocked { - return self - .checkBlocked( - self.rpc(method: "nvim_buf_get_option", params: params, expectsReturnValue: true) - ) - .map(transform) - } - - return self - .rpc(method: "nvim_buf_get_option", params: params, expectsReturnValue: true) - .map(transform) - } - - public func bufSetOption( - buffer: RxNeovimApi.Buffer, - name: String, - value: RxNeovimApi.Value, - expectsReturnValue: Bool = false - ) -> Completable { - - let params: [RxNeovimApi.Value] = [ - .int(Int64(buffer.handle)), - .string(name), - value, - ] - - if expectsReturnValue { - return self - .checkBlocked( - self.rpc(method: "nvim_buf_set_option", params: params, expectsReturnValue: expectsReturnValue) - ) - .asCompletable() - } - - return self - .rpc(method: "nvim_buf_set_option", params: params, expectsReturnValue: expectsReturnValue) - .asCompletable() - } - public func bufGetName( buffer: RxNeovimApi.Buffer, errWhenBlocked: Bool = true @@ -1073,6 +983,118 @@ extension RxNeovimApi { .map(transform) } + public func parseCmd( + str: String, + opts: Dictionary, + errWhenBlocked: Bool = true + ) -> Single> { + + let params: [RxNeovimApi.Value] = [ + .string(str), + .map(opts.mapToDict({ (Value.string($0), $1) })), + ] + + func transform(_ value: Value) throws -> Dictionary { + guard let result = (msgPackDictToSwift(value.dictionaryValue)) else { + throw RxNeovimApi.Error.conversion(type: Dictionary.self) + } + + return result + } + + if errWhenBlocked { + return self + .checkBlocked( + self.rpc(method: "nvim_parse_cmd", params: params, expectsReturnValue: true) + ) + .map(transform) + } + + return self + .rpc(method: "nvim_parse_cmd", params: params, expectsReturnValue: true) + .map(transform) + } + + public func cmd( + cmd: Dictionary, + opts: Dictionary, + errWhenBlocked: Bool = true + ) -> Single { + + let params: [RxNeovimApi.Value] = [ + .map(cmd.mapToDict({ (Value.string($0), $1) })), + .map(opts.mapToDict({ (Value.string($0), $1) })), + ] + + func transform(_ value: Value) throws -> String { + guard let result = (value.stringValue) else { + throw RxNeovimApi.Error.conversion(type: String.self) + } + + return result + } + + if errWhenBlocked { + return self + .checkBlocked( + self.rpc(method: "nvim_cmd", params: params, expectsReturnValue: true) + ) + .map(transform) + } + + return self + .rpc(method: "nvim_cmd", params: params, expectsReturnValue: true) + .map(transform) + } + + public func createUserCommand( + name: String, + command: RxNeovimApi.Value, + opts: Dictionary, + expectsReturnValue: Bool = false + ) -> Completable { + + let params: [RxNeovimApi.Value] = [ + .string(name), + command, + .map(opts.mapToDict({ (Value.string($0), $1) })), + ] + + if expectsReturnValue { + return self + .checkBlocked( + self.rpc(method: "nvim_create_user_command", params: params, expectsReturnValue: expectsReturnValue) + ) + .asCompletable() + } + + return self + .rpc(method: "nvim_create_user_command", params: params, expectsReturnValue: expectsReturnValue) + .asCompletable() + } + + public func delUserCommand( + name: String, + expectsReturnValue: Bool = false + ) -> Completable { + + let params: [RxNeovimApi.Value] = [ + .string(name), + ] + + if expectsReturnValue { + return self + .checkBlocked( + self.rpc(method: "nvim_del_user_command", params: params, expectsReturnValue: expectsReturnValue) + ) + .asCompletable() + } + + return self + .rpc(method: "nvim_del_user_command", params: params, expectsReturnValue: expectsReturnValue) + .asCompletable() + } + public func bufCreateUserCommand( buffer: RxNeovimApi.Buffer, name: String, @@ -1125,6 +1147,68 @@ extension RxNeovimApi { .asCompletable() } + public func getCommands( + opts: Dictionary, + errWhenBlocked: Bool = true + ) -> Single> { + + let params: [RxNeovimApi.Value] = [ + .map(opts.mapToDict({ (Value.string($0), $1) })), + ] + + func transform(_ value: Value) throws -> Dictionary { + guard let result = (msgPackDictToSwift(value.dictionaryValue)) else { + throw RxNeovimApi.Error.conversion(type: Dictionary.self) + } + + return result + } + + if errWhenBlocked { + return self + .checkBlocked( + self.rpc(method: "nvim_get_commands", params: params, expectsReturnValue: true) + ) + .map(transform) + } + + return self + .rpc(method: "nvim_get_commands", params: params, expectsReturnValue: true) + .map(transform) + } + + public func bufGetCommands( + buffer: RxNeovimApi.Buffer, + opts: Dictionary, + errWhenBlocked: Bool = true + ) -> Single> { + + let params: [RxNeovimApi.Value] = [ + .int(Int64(buffer.handle)), + .map(opts.mapToDict({ (Value.string($0), $1) })), + ] + + func transform(_ value: Value) throws -> Dictionary { + guard let result = (msgPackDictToSwift(value.dictionaryValue)) else { + throw RxNeovimApi.Error.conversion(type: Dictionary.self) + } + + return result + } + + if errWhenBlocked { + return self + .checkBlocked( + self.rpc(method: "nvim_buf_get_commands", params: params, expectsReturnValue: true) + ) + .map(transform) + } + + return self + .rpc(method: "nvim_buf_get_commands", params: params, expectsReturnValue: true) + .map(transform) + } + public func createNamespace( name: String, errWhenBlocked: Bool = true @@ -1422,6 +1506,293 @@ extension RxNeovimApi { .asCompletable() } + public func getOptionValue( + name: String, + opts: Dictionary, + errWhenBlocked: Bool = true + ) -> Single { + + let params: [RxNeovimApi.Value] = [ + .string(name), + .map(opts.mapToDict({ (Value.string($0), $1) })), + ] + + func transform(_ value: Value) throws -> RxNeovimApi.Value { + guard let result = (Optional(value)) else { + throw RxNeovimApi.Error.conversion(type: RxNeovimApi.Value.self) + } + + return result + } + + if errWhenBlocked { + return self + .checkBlocked( + self.rpc(method: "nvim_get_option_value", params: params, expectsReturnValue: true) + ) + .map(transform) + } + + return self + .rpc(method: "nvim_get_option_value", params: params, expectsReturnValue: true) + .map(transform) + } + + public func setOptionValue( + name: String, + value: RxNeovimApi.Value, + opts: Dictionary, + expectsReturnValue: Bool = false + ) -> Completable { + + let params: [RxNeovimApi.Value] = [ + .string(name), + value, + .map(opts.mapToDict({ (Value.string($0), $1) })), + ] + + if expectsReturnValue { + return self + .checkBlocked( + self.rpc(method: "nvim_set_option_value", params: params, expectsReturnValue: expectsReturnValue) + ) + .asCompletable() + } + + return self + .rpc(method: "nvim_set_option_value", params: params, expectsReturnValue: expectsReturnValue) + .asCompletable() + } + + public func getAllOptionsInfo( + errWhenBlocked: Bool = true + ) -> Single> { + + let params: [RxNeovimApi.Value] = [ + + ] + + func transform(_ value: Value) throws -> Dictionary { + guard let result = (msgPackDictToSwift(value.dictionaryValue)) else { + throw RxNeovimApi.Error.conversion(type: Dictionary.self) + } + + return result + } + + if errWhenBlocked { + return self + .checkBlocked( + self.rpc(method: "nvim_get_all_options_info", params: params, expectsReturnValue: true) + ) + .map(transform) + } + + return self + .rpc(method: "nvim_get_all_options_info", params: params, expectsReturnValue: true) + .map(transform) + } + + public func getOptionInfo( + name: String, + errWhenBlocked: Bool = true + ) -> Single> { + + let params: [RxNeovimApi.Value] = [ + .string(name), + ] + + func transform(_ value: Value) throws -> Dictionary { + guard let result = (msgPackDictToSwift(value.dictionaryValue)) else { + throw RxNeovimApi.Error.conversion(type: Dictionary.self) + } + + return result + } + + if errWhenBlocked { + return self + .checkBlocked( + self.rpc(method: "nvim_get_option_info", params: params, expectsReturnValue: true) + ) + .map(transform) + } + + return self + .rpc(method: "nvim_get_option_info", params: params, expectsReturnValue: true) + .map(transform) + } + + public func setOption( + name: String, + value: RxNeovimApi.Value, + expectsReturnValue: Bool = false + ) -> Completable { + + let params: [RxNeovimApi.Value] = [ + .string(name), + value, + ] + + if expectsReturnValue { + return self + .checkBlocked( + self.rpc(method: "nvim_set_option", params: params, expectsReturnValue: expectsReturnValue) + ) + .asCompletable() + } + + return self + .rpc(method: "nvim_set_option", params: params, expectsReturnValue: expectsReturnValue) + .asCompletable() + } + + public func getOption( + name: String, + errWhenBlocked: Bool = true + ) -> Single { + + let params: [RxNeovimApi.Value] = [ + .string(name), + ] + + func transform(_ value: Value) throws -> RxNeovimApi.Value { + guard let result = (Optional(value)) else { + throw RxNeovimApi.Error.conversion(type: RxNeovimApi.Value.self) + } + + return result + } + + if errWhenBlocked { + return self + .checkBlocked( + self.rpc(method: "nvim_get_option", params: params, expectsReturnValue: true) + ) + .map(transform) + } + + return self + .rpc(method: "nvim_get_option", params: params, expectsReturnValue: true) + .map(transform) + } + + public func bufGetOption( + buffer: RxNeovimApi.Buffer, + name: String, + errWhenBlocked: Bool = true + ) -> Single { + + let params: [RxNeovimApi.Value] = [ + .int(Int64(buffer.handle)), + .string(name), + ] + + func transform(_ value: Value) throws -> RxNeovimApi.Value { + guard let result = (Optional(value)) else { + throw RxNeovimApi.Error.conversion(type: RxNeovimApi.Value.self) + } + + return result + } + + if errWhenBlocked { + return self + .checkBlocked( + self.rpc(method: "nvim_buf_get_option", params: params, expectsReturnValue: true) + ) + .map(transform) + } + + return self + .rpc(method: "nvim_buf_get_option", params: params, expectsReturnValue: true) + .map(transform) + } + + public func bufSetOption( + buffer: RxNeovimApi.Buffer, + name: String, + value: RxNeovimApi.Value, + expectsReturnValue: Bool = false + ) -> Completable { + + let params: [RxNeovimApi.Value] = [ + .int(Int64(buffer.handle)), + .string(name), + value, + ] + + if expectsReturnValue { + return self + .checkBlocked( + self.rpc(method: "nvim_buf_set_option", params: params, expectsReturnValue: expectsReturnValue) + ) + .asCompletable() + } + + return self + .rpc(method: "nvim_buf_set_option", params: params, expectsReturnValue: expectsReturnValue) + .asCompletable() + } + + public func winGetOption( + window: RxNeovimApi.Window, + name: String, + errWhenBlocked: Bool = true + ) -> Single { + + let params: [RxNeovimApi.Value] = [ + .int(Int64(window.handle)), + .string(name), + ] + + func transform(_ value: Value) throws -> RxNeovimApi.Value { + guard let result = (Optional(value)) else { + throw RxNeovimApi.Error.conversion(type: RxNeovimApi.Value.self) + } + + return result + } + + if errWhenBlocked { + return self + .checkBlocked( + self.rpc(method: "nvim_win_get_option", params: params, expectsReturnValue: true) + ) + .map(transform) + } + + return self + .rpc(method: "nvim_win_get_option", params: params, expectsReturnValue: true) + .map(transform) + } + + public func winSetOption( + window: RxNeovimApi.Window, + name: String, + value: RxNeovimApi.Value, + expectsReturnValue: Bool = false + ) -> Completable { + + let params: [RxNeovimApi.Value] = [ + .int(Int64(window.handle)), + .string(name), + value, + ] + + if expectsReturnValue { + return self + .checkBlocked( + self.rpc(method: "nvim_win_set_option", params: params, expectsReturnValue: expectsReturnValue) + ) + .asCompletable() + } + + return self + .rpc(method: "nvim_win_set_option", params: params, expectsReturnValue: expectsReturnValue) + .asCompletable() + } + public func tabpageListWins( tabpage: RxNeovimApi.Tabpage, errWhenBlocked: Bool = true @@ -2420,177 +2791,6 @@ extension RxNeovimApi { .asCompletable() } - public func getOption( - name: String, - errWhenBlocked: Bool = true - ) -> Single { - - let params: [RxNeovimApi.Value] = [ - .string(name), - ] - - func transform(_ value: Value) throws -> RxNeovimApi.Value { - guard let result = (Optional(value)) else { - throw RxNeovimApi.Error.conversion(type: RxNeovimApi.Value.self) - } - - return result - } - - if errWhenBlocked { - return self - .checkBlocked( - self.rpc(method: "nvim_get_option", params: params, expectsReturnValue: true) - ) - .map(transform) - } - - return self - .rpc(method: "nvim_get_option", params: params, expectsReturnValue: true) - .map(transform) - } - - public func getOptionValue( - name: String, - opts: Dictionary, - errWhenBlocked: Bool = true - ) -> Single { - - let params: [RxNeovimApi.Value] = [ - .string(name), - .map(opts.mapToDict({ (Value.string($0), $1) })), - ] - - func transform(_ value: Value) throws -> RxNeovimApi.Value { - guard let result = (Optional(value)) else { - throw RxNeovimApi.Error.conversion(type: RxNeovimApi.Value.self) - } - - return result - } - - if errWhenBlocked { - return self - .checkBlocked( - self.rpc(method: "nvim_get_option_value", params: params, expectsReturnValue: true) - ) - .map(transform) - } - - return self - .rpc(method: "nvim_get_option_value", params: params, expectsReturnValue: true) - .map(transform) - } - - public func setOptionValue( - name: String, - value: RxNeovimApi.Value, - opts: Dictionary, - expectsReturnValue: Bool = false - ) -> Completable { - - let params: [RxNeovimApi.Value] = [ - .string(name), - value, - .map(opts.mapToDict({ (Value.string($0), $1) })), - ] - - if expectsReturnValue { - return self - .checkBlocked( - self.rpc(method: "nvim_set_option_value", params: params, expectsReturnValue: expectsReturnValue) - ) - .asCompletable() - } - - return self - .rpc(method: "nvim_set_option_value", params: params, expectsReturnValue: expectsReturnValue) - .asCompletable() - } - - public func getAllOptionsInfo( - errWhenBlocked: Bool = true - ) -> Single> { - - let params: [RxNeovimApi.Value] = [ - - ] - - func transform(_ value: Value) throws -> Dictionary { - guard let result = (msgPackDictToSwift(value.dictionaryValue)) else { - throw RxNeovimApi.Error.conversion(type: Dictionary.self) - } - - return result - } - - if errWhenBlocked { - return self - .checkBlocked( - self.rpc(method: "nvim_get_all_options_info", params: params, expectsReturnValue: true) - ) - .map(transform) - } - - return self - .rpc(method: "nvim_get_all_options_info", params: params, expectsReturnValue: true) - .map(transform) - } - - public func getOptionInfo( - name: String, - errWhenBlocked: Bool = true - ) -> Single> { - - let params: [RxNeovimApi.Value] = [ - .string(name), - ] - - func transform(_ value: Value) throws -> Dictionary { - guard let result = (msgPackDictToSwift(value.dictionaryValue)) else { - throw RxNeovimApi.Error.conversion(type: Dictionary.self) - } - - return result - } - - if errWhenBlocked { - return self - .checkBlocked( - self.rpc(method: "nvim_get_option_info", params: params, expectsReturnValue: true) - ) - .map(transform) - } - - return self - .rpc(method: "nvim_get_option_info", params: params, expectsReturnValue: true) - .map(transform) - } - - public func setOption( - name: String, - value: RxNeovimApi.Value, - expectsReturnValue: Bool = false - ) -> Completable { - - let params: [RxNeovimApi.Value] = [ - .string(name), - value, - ] - - if expectsReturnValue { - return self - .checkBlocked( - self.rpc(method: "nvim_set_option", params: params, expectsReturnValue: expectsReturnValue) - ) - .asCompletable() - } - - return self - .rpc(method: "nvim_set_option", params: params, expectsReturnValue: expectsReturnValue) - .asCompletable() - } - public func echo( chunks: RxNeovimApi.Value, history: Bool, @@ -3335,36 +3535,6 @@ extension RxNeovimApi { .asCompletable() } - public func getCommands( - opts: Dictionary, - errWhenBlocked: Bool = true - ) -> Single> { - - let params: [RxNeovimApi.Value] = [ - .map(opts.mapToDict({ (Value.string($0), $1) })), - ] - - func transform(_ value: Value) throws -> Dictionary { - guard let result = (msgPackDictToSwift(value.dictionaryValue)) else { - throw RxNeovimApi.Error.conversion(type: Dictionary.self) - } - - return result - } - - if errWhenBlocked { - return self - .checkBlocked( - self.rpc(method: "nvim_get_commands", params: params, expectsReturnValue: true) - ) - .map(transform) - } - - return self - .rpc(method: "nvim_get_commands", params: params, expectsReturnValue: true) - .map(transform) - } - public func getApiInfo( errWhenBlocked: Bool = true ) -> Single { @@ -3724,54 +3894,6 @@ extension RxNeovimApi { .map(transform) } - public func createUserCommand( - name: String, - command: RxNeovimApi.Value, - opts: Dictionary, - expectsReturnValue: Bool = false - ) -> Completable { - - let params: [RxNeovimApi.Value] = [ - .string(name), - command, - .map(opts.mapToDict({ (Value.string($0), $1) })), - ] - - if expectsReturnValue { - return self - .checkBlocked( - self.rpc(method: "nvim_create_user_command", params: params, expectsReturnValue: expectsReturnValue) - ) - .asCompletable() - } - - return self - .rpc(method: "nvim_create_user_command", params: params, expectsReturnValue: expectsReturnValue) - .asCompletable() - } - - public func delUserCommand( - name: String, - expectsReturnValue: Bool = false - ) -> Completable { - - let params: [RxNeovimApi.Value] = [ - .string(name), - ] - - if expectsReturnValue { - return self - .checkBlocked( - self.rpc(method: "nvim_del_user_command", params: params, expectsReturnValue: expectsReturnValue) - ) - .asCompletable() - } - - return self - .rpc(method: "nvim_del_user_command", params: params, expectsReturnValue: expectsReturnValue) - .asCompletable() - } - public func exec( src: String, output: Bool, @@ -3956,70 +4078,6 @@ extension RxNeovimApi { .map(transform) } - public func parseCmd( - str: String, - opts: Dictionary, - errWhenBlocked: Bool = true - ) -> Single> { - - let params: [RxNeovimApi.Value] = [ - .string(str), - .map(opts.mapToDict({ (Value.string($0), $1) })), - ] - - func transform(_ value: Value) throws -> Dictionary { - guard let result = (msgPackDictToSwift(value.dictionaryValue)) else { - throw RxNeovimApi.Error.conversion(type: Dictionary.self) - } - - return result - } - - if errWhenBlocked { - return self - .checkBlocked( - self.rpc(method: "nvim_parse_cmd", params: params, expectsReturnValue: true) - ) - .map(transform) - } - - return self - .rpc(method: "nvim_parse_cmd", params: params, expectsReturnValue: true) - .map(transform) - } - - public func cmd( - cmd: Dictionary, - opts: Dictionary, - errWhenBlocked: Bool = true - ) -> Single { - - let params: [RxNeovimApi.Value] = [ - .map(cmd.mapToDict({ (Value.string($0), $1) })), - .map(opts.mapToDict({ (Value.string($0), $1) })), - ] - - func transform(_ value: Value) throws -> String { - guard let result = (value.stringValue) else { - throw RxNeovimApi.Error.conversion(type: String.self) - } - - return result - } - - if errWhenBlocked { - return self - .checkBlocked( - self.rpc(method: "nvim_cmd", params: params, expectsReturnValue: true) - ) - .map(transform) - } - - return self - .rpc(method: "nvim_cmd", params: params, expectsReturnValue: true) - .map(transform) - } - public func openWin( buffer: RxNeovimApi.Buffer, enter: Bool, @@ -4406,64 +4464,6 @@ extension RxNeovimApi { .asCompletable() } - public func winGetOption( - window: RxNeovimApi.Window, - name: String, - errWhenBlocked: Bool = true - ) -> Single { - - let params: [RxNeovimApi.Value] = [ - .int(Int64(window.handle)), - .string(name), - ] - - func transform(_ value: Value) throws -> RxNeovimApi.Value { - guard let result = (Optional(value)) else { - throw RxNeovimApi.Error.conversion(type: RxNeovimApi.Value.self) - } - - return result - } - - if errWhenBlocked { - return self - .checkBlocked( - self.rpc(method: "nvim_win_get_option", params: params, expectsReturnValue: true) - ) - .map(transform) - } - - return self - .rpc(method: "nvim_win_get_option", params: params, expectsReturnValue: true) - .map(transform) - } - - public func winSetOption( - window: RxNeovimApi.Window, - name: String, - value: RxNeovimApi.Value, - expectsReturnValue: Bool = false - ) -> Completable { - - let params: [RxNeovimApi.Value] = [ - .int(Int64(window.handle)), - .string(name), - value, - ] - - if expectsReturnValue { - return self - .checkBlocked( - self.rpc(method: "nvim_win_set_option", params: params, expectsReturnValue: expectsReturnValue) - ) - .asCompletable() - } - - return self - .rpc(method: "nvim_win_set_option", params: params, expectsReturnValue: expectsReturnValue) - .asCompletable() - } - public func winGetPosition( window: RxNeovimApi.Window, errWhenBlocked: Bool = true