Skip to content

Commit

Permalink
Merge pull request #25 from vim-denops/v7-pre
Browse files Browse the repository at this point in the history
🎉 For Denops v7
  • Loading branch information
lambdalisue authored Jul 20, 2024
2 parents c7d76f1 + b72ac57 commit e6c7494
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 25 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ jobs:
- macos-latest
- ubuntu-latest
deno_version:
- "1.43.x"
- "1.45.x"
- "1.x"
host_version:
- vim: "v9.1.0399"
nvim: "v0.9.5"
- vim: "v9.1.0448"
nvim: "v0.10.0"

runs-on: ${{ matrix.runner }}

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ jobs:
- macos-latest
- ubuntu-latest
deno_version:
- "1.43.x"
- "1.45.x"
- "1.x"
host_version:
- vim: "v9.1.0399"
nvim: "v0.9.5"
- vim: "v9.1.0448"
nvim: "v0.10.0"

runs-on: ${{ matrix.runner }}

Expand Down
2 changes: 1 addition & 1 deletion conf.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { resolve } from "jsr:@std/path@0.225.0/resolve";
import { resolve } from "jsr:@std/path@1.0.1/resolve";

let conf: Config | undefined;

Expand Down
6 changes: 3 additions & 3 deletions conf_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import {
assertEquals,
assertObjectMatch,
assertThrows,
} from "jsr:@std/assert@0.225.1";
import { stub } from "jsr:@std/testing@0.224/mock";
import { basename, isAbsolute } from "jsr:@std/path@0.224.0";
} from "jsr:@std/assert@1.0.0";
import { stub } from "jsr:@std/testing@0.225.3/mock";
import { basename, isAbsolute } from "jsr:@std/path@1.0.1";
import { _internal, getConfig } from "./conf.ts";

const ENV_VARS: Readonly<Record<string, string | undefined>> = {
Expand Down
3 changes: 2 additions & 1 deletion denops.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import type { Context, Denops, Dispatcher, Meta } from "jsr:@denops/core@6.0.6";
import type { Context, Denops, Dispatcher, Meta } from "jsr:@denops/core@7.0.0";
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";
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
2 changes: 1 addition & 1 deletion runner.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { mergeReadableStreams } from "jsr:@std/[email protected].0/merge-readable-streams";
import { mergeReadableStreams } from "jsr:@std/[email protected].5/merge-readable-streams";
import { is } from "jsr:@core/[email protected]";
import { unreachable } from "jsr:@lambdalisue/[email protected]";
import { type Config, getConfig } from "./conf.ts";
Expand Down
12 changes: 11 additions & 1 deletion stub.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Context, Denops, Dispatcher, Meta } from "jsr:@denops/core@6.0.6";
import type { Context, Denops, Dispatcher, Meta } from "jsr:@denops/core@7.0.0";

/**
* Represents a stubber object for `Denops`.
Expand All @@ -22,6 +22,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 +102,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.
Expand Down
6 changes: 3 additions & 3 deletions stub_test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assertSpyCall, spy } from "jsr:@std/testing@0.224.0/mock";
import { assertEquals } from "jsr:@std/assert@0.225.1";
import type { Denops } from "jsr:@denops/core@6.0.6";
import { assertSpyCall, spy } from "jsr:@std/testing@0.225.3/mock";
import { assertEquals } from "jsr:@std/assert@1.0.0";
import type { Denops } from "jsr:@denops/core@7.0.0";
import { DenopsStub } from "./stub.ts";

Deno.test("`DenopsStub`", async (t) => {
Expand Down
4 changes: 2 additions & 2 deletions tester.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { sample } from "jsr:@std/collections@0.224.1/sample";
import type { Denops } from "jsr:@denops/core@6.0.6";
import { sample } from "jsr:@std/collections@1.0.5/sample";
import type { Denops } from "jsr:@denops/core@7.0.0";
import type { RunMode } from "./runner.ts";
import { withDenops } from "./with.ts";

Expand Down
2 changes: 1 addition & 1 deletion tester_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
assertEquals,
assertFalse,
assertThrows,
} from "jsr:@std/assert@0.225.1";
} from "jsr:@std/assert@1.0.0";
import { test } from "./tester.ts";

test({
Expand Down
4 changes: 2 additions & 2 deletions with.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { deadline } from "jsr:@std/async@0.224.0/deadline";
import { deadline } from "jsr:@std/async@1.0.0/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";
import { getConfig } from "./conf.ts";
import { run, type RunMode } from "./runner.ts";
import { DenopsImpl } from "./denops.ts";
Expand Down
6 changes: 3 additions & 3 deletions with_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import {
assertEquals,
assertFalse,
assertRejects,
} from "jsr:@std/assert@0.225.1";
import { assertSpyCalls, spy, stub } from "jsr:@std/testing@0.224.0/mock";
import type { Denops } from "jsr:@denops/core@6.0.6";
} from "jsr:@std/assert@1.0.0";
import { assertSpyCalls, spy, stub } from "jsr:@std/testing@0.225.3/mock";
import type { Denops } from "jsr:@denops/core@7.0.0";
import { withDenops } from "./with.ts";

Deno.test("test(mode:vim) start vim to test denops features", async () => {
Expand Down

0 comments on commit e6c7494

Please sign in to comment.