-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c7d76f1
commit 315d3ac
Showing
7 changed files
with
28 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
import type { Context, Denops, Dispatcher, Meta } from "jsr:@denops/[email protected]"; | ||
import type { | ||
Context, | ||
Denops, | ||
Dispatcher, | ||
Meta, | ||
} from "jsr:@denops/[email protected]"; | ||
import type { Client } from "jsr:@lambdalisue/[email protected]"; | ||
|
||
export class DenopsImpl implements Denops { | ||
readonly name: string; | ||
readonly meta: Meta; | ||
readonly context: Record<string | number | symbol, unknown> = {}; | ||
readonly interrupted = AbortSignal.any([]); | ||
|
||
dispatcher: Dispatcher = {}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import type { Denops } from "jsr:@denops/core@6.0.6"; | ||
import type { Denops } from "jsr:@denops/core@7.0.0-pre0"; | ||
import { assert, ensure, is } from "jsr:@core/[email protected]"; | ||
import { Client, Session } from "jsr:@lambdalisue/[email protected]"; | ||
import { errorDeserializer, errorSerializer } from "./error.ts"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
import type { Context, Denops, Dispatcher, Meta } from "jsr:@denops/[email protected]"; | ||
import type { | ||
Context, | ||
Denops, | ||
Dispatcher, | ||
Meta, | ||
} from "jsr:@denops/[email protected]"; | ||
|
||
/** | ||
* Represents a stubber object for `Denops`. | ||
|
@@ -22,6 +27,12 @@ export interface DenopsStubber { | |
* ``` | ||
*/ | ||
meta?: Meta; | ||
|
||
/** | ||
* AbortSignal instance that is triggered when the user invoke `denops#interrupt()` | ||
* If not specified, it returns a new instance of `AbortSignal`. | ||
*/ | ||
interrupted?: AbortSignal; | ||
/** | ||
* A stub function for the `redraw` method of `Denops`. | ||
* If not specified, it returns a promise resolving to undefined. | ||
|
@@ -96,6 +107,10 @@ export class DenopsStub implements Denops { | |
}; | ||
} | ||
|
||
get interrupted(): AbortSignal { | ||
return this.#stubber.interrupted ?? AbortSignal.any([]); | ||
} | ||
|
||
/** | ||
* A stub function for the `redraw` method of `Denops`. | ||
* If not specified, it returns a promise resolving to undefined. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { assertSpyCall, spy } from "jsr:@std/[email protected]/mock"; | ||
import { assertEquals } from "jsr:@std/[email protected]"; | ||
import type { Denops } from "jsr:@denops/core@6.0.6"; | ||
import type { Denops } from "jsr:@denops/core@7.0.0-pre0"; | ||
import { DenopsStub } from "./stub.ts"; | ||
|
||
Deno.test("`DenopsStub`", async (t) => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { sample } from "jsr:@std/[email protected]/sample"; | ||
import type { Denops } from "jsr:@denops/core@6.0.6"; | ||
import type { Denops } from "jsr:@denops/core@7.0.0-pre0"; | ||
import type { RunMode } from "./runner.ts"; | ||
import { withDenops } from "./with.ts"; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { deadline } from "jsr:@std/[email protected]/deadline"; | ||
import { assert, is } from "jsr:@core/[email protected]"; | ||
import { Client, Session } from "jsr:@lambdalisue/[email protected]"; | ||
import type { Denops, Meta } from "jsr:@denops/core@6.0.6"; | ||
import type { Denops, Meta } from "jsr:@denops/core@7.0.0-pre0"; | ||
import { getConfig } from "./conf.ts"; | ||
import { run, type RunMode } from "./runner.ts"; | ||
import { DenopsImpl } from "./denops.ts"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ import { | |
assertRejects, | ||
} from "jsr:@std/[email protected]"; | ||
import { assertSpyCalls, spy, stub } from "jsr:@std/[email protected]/mock"; | ||
import type { Denops } from "jsr:@denops/core@6.0.6"; | ||
import type { Denops } from "jsr:@denops/core@7.0.0-pre0"; | ||
import { withDenops } from "./with.ts"; | ||
|
||
Deno.test("test(mode:vim) start vim to test denops features", async () => { | ||
|