1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-09-11 17:15:34 +03:00
This commit is contained in:
Tae Won Ha 2022-06-17 22:42:20 +02:00
parent 2baf8a437f
commit 050537eeb7
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44
23 changed files with 10 additions and 4864 deletions

View File

@ -51,18 +51,6 @@ class UrlCommonsTest: XCTestCase {
expect(URL(fileURLWithPath: "/").parent).to(equal(URL(fileURLWithPath: "/")))
}
func testIsDir() {
let resourceUrl = Bundle.module.url(
forResource: "UrlCommonsTest",
withExtension: "",
subdirectory: "Resources"
)!
let hidden = resourceUrl.appendingPathComponent(".dot-hidden-file")
expect(resourceUrl.isDir).to(beTrue())
expect(hidden.isDir).to(beFalse())
}
func testIsHidden() {
let resourceUrl = Bundle.module.url(
forResource: "UrlCommonsTest",

View File

@ -1,9 +0,0 @@
import XCTest
#if !canImport(ObjectiveC)
public func allTests() -> [XCTestCaseEntry] {
[
testCase(CommonsTests.allTests),
]
}
#endif

View File

@ -1,7 +0,0 @@
import XCTest
import CommonsTests
var tests = [XCTestCaseEntry]()
tests += CommonsTests.allTests()
XCTMain(tests)

View File

@ -24,6 +24,7 @@ let package = Package(
"RxSwift",
"RxPack",
"Tabs",
.product(name: "RxNeovim", package: "NvimServer"),
.product(name: "NvimServerTypes", package: "NvimServer"),
.product(name: "MessagePack", package: "MessagePack.swift"),
"Commons",

View File

@ -5,6 +5,7 @@
import Foundation
import RxPack
import RxNeovim
import RxSwift
public extension RxNeovimApi {

View File

@ -8,6 +8,7 @@ import MessagePack
import PureLayout
import RxPack
import RxSwift
import RxNeovim
import SpriteKit
public extension NvimView {

View File

@ -5,6 +5,7 @@
import Foundation
import RxPack
import RxNeovim
public extension NvimView {
struct Buffer: Equatable {

View File

@ -7,6 +7,7 @@
import Cocoa
import RxPack
import RxSwift
import RxNeovim
extension NvimView: NSTouchBarDelegate, NSScrubberDataSource, NSScrubberDelegate {
override public func makeTouchBar() -> NSTouchBar? {

View File

@ -7,6 +7,7 @@ import Cocoa
import MessagePack
import PureLayout
import RxPack
import RxNeovim
import Tabs
public extension NvimView {

View File

@ -11,6 +11,7 @@ import NvimServerTypes
import os
import RxPack
import RxSwift
import RxNeovim
extension NvimView {
final func initVimError() {

View File

@ -9,6 +9,7 @@ import Commons
import MessagePack
import os
import RxPack
import RxNeovim
import RxSwift
import Tabs
import SpriteKit

View File

@ -1,7 +0,0 @@
import XCTest
import NvimViewTests
var tests = [XCTestCaseEntry]()
tests += NvimViewTests.allTests()
XCTMain(tests)

View File

@ -1,9 +0,0 @@
import XCTest
#if !canImport(ObjectiveC)
public func allTests() -> [XCTestCaseEntry] {
[
testCase(NvimViewTests.allTests),
]
}
#endif

View File

@ -12,7 +12,6 @@ let package = Package(
.package(url: "https://github.com/ReactiveX/RxSwift", .upToNextMinor(from: "6.5.0")),
.package(url: "https://github.com/a2/MessagePack.swift", from: "4.0.0"),
.package(url: "https://github.com/IBM-Swift/BlueSocket", from: "2.0.2"),
.package(url: "https://github.com/Quick/Nimble", from: "10.0.0"),
],
targets: [
.target(name: "RxPack", dependencies: [
@ -20,6 +19,6 @@ let package = Package(
.product(name: "MessagePack", package: "MessagePack.swift"),
.product(name: "Socket", package: "BlueSocket"),
]),
.testTarget(name: "RxPackTests", dependencies: ["RxPack", "Nimble"]),
.testTarget(name: "RxPackTests", dependencies: ["RxPack"]),
]
)

File diff suppressed because it is too large Load Diff

View File

@ -1,71 +0,0 @@
/**
* Tae Won Ha - http://taewon.de - @hataewon
* See LICENSE
*/
import Foundation
import RxSwift
public final class RxNeovimApi {
public enum Event {
case error(msg: String)
}
public struct Buffer: Equatable, Hashable {
public let handle: Int
public init(_ handle: Int) { self.handle = handle }
}
public struct Window: Equatable, Hashable {
public let handle: Int
public init(_ handle: Int) { self.handle = handle }
}
public struct Tabpage: Equatable, Hashable {
public let handle: Int
public init(_ handle: Int) { self.handle = handle }
}
public typealias Value = RxMsgpackRpc.Value
public var streamResponses: Bool {
get { self.msgpackRpc.streamResponses }
set { self.msgpackRpc.streamResponses = newValue }
}
public var msgpackRawStream: Observable<RxMsgpackRpc.Message> { self.msgpackRpc.stream }
public func run(at path: String) -> Completable { self.msgpackRpc.run(at: path) }
public func stop() -> Completable { self.msgpackRpc.stop() }
public func checkBlocked<T>(_ single: Single<T>) -> Single<T> {
self
.getMode()
.flatMap { dict -> Single<T> in
guard (dict["blocking"]?.boolValue ?? false) == false else {
throw RxNeovimApi.Error.blocked
}
return single
}
}
public func rpc(
method: String,
params: [RxNeovimApi.Value],
expectsReturnValue: Bool = true
) -> Single<RxNeovimApi.Value> {
self.msgpackRpc
.request(method: method, params: params, expectsReturnValue: expectsReturnValue)
.map { response -> RxMsgpackRpc.Value in
guard response.error.isNil else { throw RxNeovimApi.Error(response.error) }
return response.result
}
}
public init() {}
private let msgpackRpc = RxMsgpackRpc(queueQos: .userInitiated)
}

View File

@ -1,7 +0,0 @@
import XCTest
import RxPackTests
var tests = [XCTestCaseEntry]()
tests += RxPackTests.allTests()
XCTMain(tests)

View File

@ -1,9 +0,0 @@
import XCTest
#if !canImport(ObjectiveC)
public func allTests() -> [XCTestCaseEntry] {
[
testCase(RxPackTests.allTests),
]
}
#endif

View File

@ -1,7 +0,0 @@
import XCTest
import TabsTests
var tests = [XCTestCaseEntry]()
tests += TabsTests.allTests()
XCTMain(tests)

View File

@ -1,9 +0,0 @@
import XCTest
#if !canImport(ObjectiveC)
public func allTests() -> [XCTestCaseEntry] {
[
testCase(TabsTests.allTests),
]
}
#endif

View File

@ -7,6 +7,7 @@ import Cocoa
import NvimView
import RxPack
import RxSwift
import RxNeovim
import Workspace
// MARK: - NvimViewDelegate

View File

@ -1,7 +0,0 @@
import XCTest
import WorkspaceTests
var tests = [XCTestCaseEntry]()
tests += WorkspaceTests.allTests()
XCTMain(tests)

View File

@ -1,9 +0,0 @@
import XCTest
#if !canImport(ObjectiveC)
public func allTests() -> [XCTestCaseEntry] {
[
testCase(WorkspaceTests.allTests),
]
}
#endif