mirror of
https://github.com/qvacua/vimr.git
synced 2024-09-11 17:15:34 +03:00
wip
This commit is contained in:
parent
2baf8a437f
commit
050537eeb7
@ -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",
|
||||
|
@ -1,9 +0,0 @@
|
||||
import XCTest
|
||||
|
||||
#if !canImport(ObjectiveC)
|
||||
public func allTests() -> [XCTestCaseEntry] {
|
||||
[
|
||||
testCase(CommonsTests.allTests),
|
||||
]
|
||||
}
|
||||
#endif
|
@ -1,7 +0,0 @@
|
||||
import XCTest
|
||||
|
||||
import CommonsTests
|
||||
|
||||
var tests = [XCTestCaseEntry]()
|
||||
tests += CommonsTests.allTests()
|
||||
XCTMain(tests)
|
@ -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",
|
||||
|
@ -5,6 +5,7 @@
|
||||
|
||||
import Foundation
|
||||
import RxPack
|
||||
import RxNeovim
|
||||
import RxSwift
|
||||
|
||||
public extension RxNeovimApi {
|
||||
|
@ -8,6 +8,7 @@ import MessagePack
|
||||
import PureLayout
|
||||
import RxPack
|
||||
import RxSwift
|
||||
import RxNeovim
|
||||
import SpriteKit
|
||||
|
||||
public extension NvimView {
|
||||
|
@ -5,6 +5,7 @@
|
||||
|
||||
import Foundation
|
||||
import RxPack
|
||||
import RxNeovim
|
||||
|
||||
public extension NvimView {
|
||||
struct Buffer: Equatable {
|
||||
|
@ -7,6 +7,7 @@
|
||||
import Cocoa
|
||||
import RxPack
|
||||
import RxSwift
|
||||
import RxNeovim
|
||||
|
||||
extension NvimView: NSTouchBarDelegate, NSScrubberDataSource, NSScrubberDelegate {
|
||||
override public func makeTouchBar() -> NSTouchBar? {
|
||||
|
@ -7,6 +7,7 @@ import Cocoa
|
||||
import MessagePack
|
||||
import PureLayout
|
||||
import RxPack
|
||||
import RxNeovim
|
||||
import Tabs
|
||||
|
||||
public extension NvimView {
|
||||
|
@ -11,6 +11,7 @@ import NvimServerTypes
|
||||
import os
|
||||
import RxPack
|
||||
import RxSwift
|
||||
import RxNeovim
|
||||
|
||||
extension NvimView {
|
||||
final func initVimError() {
|
||||
|
@ -9,6 +9,7 @@ import Commons
|
||||
import MessagePack
|
||||
import os
|
||||
import RxPack
|
||||
import RxNeovim
|
||||
import RxSwift
|
||||
import Tabs
|
||||
import SpriteKit
|
||||
|
@ -1,7 +0,0 @@
|
||||
import XCTest
|
||||
|
||||
import NvimViewTests
|
||||
|
||||
var tests = [XCTestCaseEntry]()
|
||||
tests += NvimViewTests.allTests()
|
||||
XCTMain(tests)
|
@ -1,9 +0,0 @@
|
||||
import XCTest
|
||||
|
||||
#if !canImport(ObjectiveC)
|
||||
public func allTests() -> [XCTestCaseEntry] {
|
||||
[
|
||||
testCase(NvimViewTests.allTests),
|
||||
]
|
||||
}
|
||||
#endif
|
@ -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
@ -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)
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
import XCTest
|
||||
|
||||
import RxPackTests
|
||||
|
||||
var tests = [XCTestCaseEntry]()
|
||||
tests += RxPackTests.allTests()
|
||||
XCTMain(tests)
|
@ -1,9 +0,0 @@
|
||||
import XCTest
|
||||
|
||||
#if !canImport(ObjectiveC)
|
||||
public func allTests() -> [XCTestCaseEntry] {
|
||||
[
|
||||
testCase(RxPackTests.allTests),
|
||||
]
|
||||
}
|
||||
#endif
|
@ -1,7 +0,0 @@
|
||||
import XCTest
|
||||
|
||||
import TabsTests
|
||||
|
||||
var tests = [XCTestCaseEntry]()
|
||||
tests += TabsTests.allTests()
|
||||
XCTMain(tests)
|
@ -1,9 +0,0 @@
|
||||
import XCTest
|
||||
|
||||
#if !canImport(ObjectiveC)
|
||||
public func allTests() -> [XCTestCaseEntry] {
|
||||
[
|
||||
testCase(TabsTests.allTests),
|
||||
]
|
||||
}
|
||||
#endif
|
@ -7,6 +7,7 @@ import Cocoa
|
||||
import NvimView
|
||||
import RxPack
|
||||
import RxSwift
|
||||
import RxNeovim
|
||||
import Workspace
|
||||
|
||||
// MARK: - NvimViewDelegate
|
||||
|
@ -1,7 +0,0 @@
|
||||
import XCTest
|
||||
|
||||
import WorkspaceTests
|
||||
|
||||
var tests = [XCTestCaseEntry]()
|
||||
tests += WorkspaceTests.allTests()
|
||||
XCTMain(tests)
|
@ -1,9 +0,0 @@
|
||||
import XCTest
|
||||
|
||||
#if !canImport(ObjectiveC)
|
||||
public func allTests() -> [XCTestCaseEntry] {
|
||||
[
|
||||
testCase(WorkspaceTests.allTests),
|
||||
]
|
||||
}
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user