Skip to content

Commit

Permalink
📦 Use @denops/core v7.0.0-pre0
Browse files Browse the repository at this point in the history
  • Loading branch information
lambdalisue committed Jul 7, 2024
1 parent c7d76f1 commit 315d3ac
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 7 deletions.
8 changes: 7 additions & 1 deletion denops.ts
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 = {};

Expand Down
2 changes: 1 addition & 1 deletion plugin.ts
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";
Expand Down
17 changes: 16 additions & 1 deletion stub.ts
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`.
Expand All @@ -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.
Expand Down Expand Up @@ -96,6 +107,10 @@ export class DenopsStub implements Denops {
};
}

get interrupted(): AbortSignal {
return this.#stubber.interrupted ?? AbortSignal.any([]);
}

Check warning on line 112 in stub.ts

View check run for this annotation

Codecov / codecov/patch

stub.ts#L110-L112

Added lines #L110 - L112 were not covered by tests

/**
* A stub function for the `redraw` method of `Denops`.
* If not specified, it returns a promise resolving to undefined.
Expand Down
2 changes: 1 addition & 1 deletion stub_test.ts
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) => {
Expand Down
2 changes: 1 addition & 1 deletion tester.ts
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";

Expand Down
2 changes: 1 addition & 1 deletion with.ts
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";
Expand Down
2 changes: 1 addition & 1 deletion with_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down

0 comments on commit 315d3ac

Please sign in to comment.