Skip to content

Commit 488361c

Browse files
authored
Merge pull request #144 from vim-denops/automation/update-dependencies
📦 Update Deno dependencies
2 parents 8c67cd5 + 4621d7a commit 488361c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+225
-92
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
- vim: "v8.2.3452"
7272
nvim: "v0.6.0"
7373
runs-on: ${{ matrix.runner }}
74-
timeout-minutes: 5
74+
timeout-minutes: 15
7575
steps:
7676
- run: git config --global core.autocrlf false
7777
if: runner.os == 'Windows'

denops_std/anonymous/mod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Denops } from "https://deno.land/x/denops_core@v3.1.0/mod.ts";
1+
import type { Denops } from "https://deno.land/x/denops_core@v3.2.0/mod.ts";
22

33
// https://github.com/microsoft/TypeScript/issues/26223#issuecomment-674500430
44
export type TupleOf<T, N extends number> = N extends N

denops_std/anonymous/mod_test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {
22
assertEquals,
33
assertRejects,
4-
} from "https://deno.land/std@0.151.0/testing/asserts.ts";
5-
import { test } from "https://deno.land/x/denops_core@v3.1.0/test/mod.ts";
4+
} from "https://deno.land/std@0.159.0/testing/asserts.ts";
5+
import { test } from "https://deno.land/x/denops_core@v3.2.0/test/mod.ts";
66
import * as anonymous from "./mod.ts";
77

88
test({

denops_std/argument/flags_test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assertEquals } from "https://deno.land/std@0.151.0/testing/asserts.ts";
1+
import { assertEquals } from "https://deno.land/std@0.159.0/testing/asserts.ts";
22
import { parseFlags } from "./flags.ts";
33

44
Deno.test("parseFlags", () => {

denops_std/argument/mod_test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assertEquals } from "https://deno.land/std@0.151.0/testing/asserts.ts";
1+
import { assertEquals } from "https://deno.land/std@0.159.0/testing/asserts.ts";
22
import { parse } from "./mod.ts";
33

44
Deno.test("parse", () => {

denops_std/argument/opts_test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assertEquals } from "https://deno.land/std@0.151.0/testing/asserts.ts";
1+
import { assertEquals } from "https://deno.land/std@0.159.0/testing/asserts.ts";
22
import { parseOpts } from "./opts.ts";
33

44
Deno.test("parseOpts", () => {

denops_std/autocmd/common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Denops } from "https://deno.land/x/denops_core@v3.1.0/mod.ts";
1+
import { Denops } from "https://deno.land/x/denops_core@v3.2.0/mod.ts";
22
import { AutocmdEvent } from "./types.ts";
33

44
type CommonOptions = {

denops_std/autocmd/common_test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { assertEquals } from "https://deno.land/std@0.151.0/testing/asserts.ts";
2-
import { test } from "https://deno.land/x/denops_core@v3.1.0/test/mod.ts";
1+
import { assertEquals } from "https://deno.land/std@0.159.0/testing/asserts.ts";
2+
import { test } from "https://deno.land/x/denops_core@v3.2.0/test/mod.ts";
33
import { globals } from "../variable/mod.ts";
44
import { define, emit, emitAll, list, remove } from "./common.ts";
55

denops_std/autocmd/group.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Denops } from "https://deno.land/x/denops_core@v3.1.0/mod.ts";
1+
import type { Denops } from "https://deno.land/x/denops_core@v3.2.0/mod.ts";
22
import { execute } from "../helper/execute.ts";
33
import { AutocmdEvent } from "./types.ts";
44
import {

denops_std/autocmd/group_test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { assertEquals } from "https://deno.land/std@0.151.0/testing/asserts.ts";
2-
import { test } from "https://deno.land/x/denops_core@v3.1.0/test/mod.ts";
1+
import { assertEquals } from "https://deno.land/std@0.159.0/testing/asserts.ts";
2+
import { test } from "https://deno.land/x/denops_core@v3.2.0/test/mod.ts";
33
import { globals } from "../variable/mod.ts";
44
import { group } from "./group.ts";
55

denops_std/batch/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ export async function main(denops: Denops): Promise<void> {
9494
}
9595
```
9696

97+
Note that `denops.redraw()` is executed only once after the batch is actually
98+
executed, no matter how many times it is called in the `batch()`. If the `force`
99+
option is specified even once, the last call will be the one with the force
100+
option specified.
101+
97102
### gather
98103

99104
Use `gather()` to call multiple denops functions sequentially without overhead
@@ -138,3 +143,6 @@ export async function main(denops: Denops): Promise<void> {
138143
The `denops` instance passed to the `gather` block is NOT available outside of
139144
the block. An error is thrown when `denops.call()`, `denops.cmd()`, or
140145
`denops.eval()` is called.
146+
147+
Note that `denops.redraw()` cannot be called within `gather()`. If it is called,
148+
an error is raised.

denops_std/batch/batch.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ import type {
33
Denops,
44
Dispatcher,
55
Meta,
6-
} from "https://deno.land/x/denops_core@v3.1.0/mod.ts";
6+
} from "https://deno.land/x/denops_core@v3.2.0/mod.ts";
7+
8+
type Redraw = undefined | boolean;
79

810
class BatchHelper implements Denops {
911
#denops: Denops;
1012
#calls: [string, ...unknown[]][];
13+
#redraw: Redraw;
1114
#closed: boolean;
1215

1316
constructor(denops: Denops) {
@@ -20,6 +23,10 @@ class BatchHelper implements Denops {
2023
return helper.#calls;
2124
}
2225

26+
static getRedraw(helper: BatchHelper): Redraw {
27+
return helper.#redraw;
28+
}
29+
2330
static close(helper: BatchHelper): void {
2431
helper.#closed = true;
2532
}
@@ -44,6 +51,12 @@ class BatchHelper implements Denops {
4451
this.#denops.dispatcher = dispatcher;
4552
}
4653

54+
redraw(force?: boolean): Promise<void> {
55+
// Prefer 'force' if the method is called multiple times
56+
this.#redraw = !!this.#redraw || !!force;
57+
return Promise.resolve();
58+
}
59+
4760
call(fn: string, ...args: unknown[]): Promise<unknown> {
4861
if (this.#closed) {
4962
return this.#denops.call(fn, ...args);
@@ -96,6 +109,10 @@ export async function batch(
96109
}
97110
const calls = BatchHelper.getCalls(helper);
98111
await denops.batch(...calls);
112+
const redraw = BatchHelper.getRedraw(helper);
113+
if (redraw != null) {
114+
await denops.redraw(redraw);
115+
}
99116
}
100117

101118
export type { BatchHelper };

denops_std/batch/batch_test.ts

Lines changed: 91 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
import { assertEquals } from "https://deno.land/std@0.151.0/testing/asserts.ts";
2-
import { test } from "https://deno.land/x/denops_core@v3.1.0/test/mod.ts";
1+
import { assertEquals } from "https://deno.land/std@0.159.0/testing/asserts.ts";
2+
import {
3+
assertSpyCall,
4+
assertSpyCalls,
5+
spy,
6+
} from "https://deno.land/std@0.159.0/testing/mock.ts";
7+
import { test } from "https://deno.land/x/denops_core@v3.2.0/test/mod.ts";
38
import { batch, BatchHelper } from "./batch.ts";
49

510
test({
@@ -161,3 +166,87 @@ test({
161166
]);
162167
},
163168
});
169+
test({
170+
mode: "any",
171+
name:
172+
"batch() invokes 'redraw()' only once after the batch is actually executed.",
173+
fn: async (denops) => {
174+
await denops.cmd("let g:denops_batch_test = []");
175+
await denops.cmd(
176+
"command! -nargs=1 DenopsBatchTest let g:denops_batch_test += [<f-args>]",
177+
);
178+
const redrawSpy = spy(denops, "redraw");
179+
try {
180+
await batch(denops, async (denops) => {
181+
assertEquals(
182+
await denops.call("execute", "DenopsBatchTest 1"),
183+
undefined,
184+
);
185+
await denops.redraw();
186+
assertEquals(
187+
await denops.call("execute", "DenopsBatchTest 2"),
188+
undefined,
189+
);
190+
await denops.redraw();
191+
assertEquals(
192+
await denops.call("execute", "DenopsBatchTest 3"),
193+
undefined,
194+
);
195+
await denops.redraw();
196+
});
197+
} finally {
198+
redrawSpy.restore();
199+
}
200+
assertEquals(await denops.eval("g:denops_batch_test") as string[], [
201+
"1",
202+
"2",
203+
"3",
204+
]);
205+
assertSpyCalls(redrawSpy, 1);
206+
assertSpyCall(redrawSpy, 0, {
207+
args: [false],
208+
});
209+
},
210+
});
211+
test({
212+
mode: "any",
213+
name:
214+
"batch() invokes 'redraw(true)' only once after the batch is actually executed.",
215+
fn: async (denops) => {
216+
await denops.cmd("let g:denops_batch_test = []");
217+
await denops.cmd(
218+
"command! -nargs=1 DenopsBatchTest let g:denops_batch_test += [<f-args>]",
219+
);
220+
const redrawSpy = spy(denops, "redraw");
221+
try {
222+
await batch(denops, async (denops) => {
223+
assertEquals(
224+
await denops.call("execute", "DenopsBatchTest 1"),
225+
undefined,
226+
);
227+
await denops.redraw();
228+
assertEquals(
229+
await denops.call("execute", "DenopsBatchTest 2"),
230+
undefined,
231+
);
232+
await denops.redraw(true);
233+
assertEquals(
234+
await denops.call("execute", "DenopsBatchTest 3"),
235+
undefined,
236+
);
237+
await denops.redraw();
238+
});
239+
} finally {
240+
redrawSpy.restore();
241+
}
242+
assertEquals(await denops.eval("g:denops_batch_test") as string[], [
243+
"1",
244+
"2",
245+
"3",
246+
]);
247+
assertSpyCalls(redrawSpy, 1);
248+
assertSpyCall(redrawSpy, 0, {
249+
args: [true],
250+
});
251+
},
252+
});

denops_std/batch/gather.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type {
33
Denops,
44
Dispatcher,
55
Meta,
6-
} from "https://deno.land/x/denops_core@v3.1.0/mod.ts";
6+
} from "https://deno.land/x/denops_core@v3.2.0/mod.ts";
77

88
class GatherHelper implements Denops {
99
#denops: Denops;
@@ -44,6 +44,10 @@ class GatherHelper implements Denops {
4444
this.#denops.dispatcher = dispatcher;
4545
}
4646

47+
redraw(_force?: boolean): Promise<void> {
48+
throw new Error("The 'redraw' method is not available on GatherHelper.");
49+
}
50+
4751
call(fn: string, ...args: unknown[]): Promise<unknown> {
4852
if (this.#closed) {
4953
throw new Error(

denops_std/batch/gather_test.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {
22
assertEquals,
33
assertRejects,
4-
} from "https://deno.land/std@0.151.0/testing/asserts.ts";
5-
import { test } from "https://deno.land/x/denops_core@v3.1.0/test/mod.ts";
4+
} from "https://deno.land/std@0.159.0/testing/asserts.ts";
5+
import { test } from "https://deno.land/x/denops_core@v3.2.0/test/mod.ts";
66
import { gather, GatherHelper } from "./gather.ts";
77

88
test({
@@ -93,3 +93,18 @@ test({
9393
);
9494
},
9595
});
96+
test({
97+
mode: "any",
98+
name: "gather() throws an error when 'denops.redraw()' is called.",
99+
fn: async (denops) => {
100+
await assertRejects(
101+
async () => {
102+
await gather(denops, async (denops) => {
103+
await denops.redraw();
104+
});
105+
},
106+
"method is not available",
107+
);
108+
},
109+
prelude: ["let g:denops#enable_workaround_vim_before_8_2_3081 = 1"],
110+
});

denops_std/buffer/buffer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Denops } from "https://deno.land/x/denops_core@v3.1.0/mod.ts";
1+
import type { Denops } from "https://deno.land/x/denops_core@v3.2.0/mod.ts";
22
import * as autocmd from "../autocmd/mod.ts";
33
import * as batch from "../batch/mod.ts";
44
import * as fn from "../function/mod.ts";

denops_std/buffer/buffer_test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assertEquals } from "https://deno.land/std@0.151.0/testing/asserts.ts";
1+
import { assertEquals } from "https://deno.land/std@0.159.0/testing/asserts.ts";
22
import { test } from "../test/mod.ts";
33
import { default as Encoding } from "https://cdn.skypack.dev/encoding-japanese@2.0.0/";
44
import * as fn from "../function/mod.ts";

denops_std/buffer/decoration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Denops } from "https://deno.land/x/denops_core@v3.1.0/mod.ts";
1+
import type { Denops } from "https://deno.land/x/denops_core@v3.2.0/mod.ts";
22
import * as batch from "../batch/mod.ts";
33
import * as vimFn from "../function/vim/mod.ts";
44
import * as nvimFn from "../function/nvim/mod.ts";

denops_std/buffer/fileencoding_test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assertEquals } from "https://deno.land/std@0.151.0/testing/asserts.ts";
1+
import { assertEquals } from "https://deno.land/std@0.159.0/testing/asserts.ts";
22
import { default as Encoding } from "https://cdn.skypack.dev/encoding-japanese@2.0.0/";
33
import { tryDecode } from "./fileencoding.ts";
44

denops_std/buffer/fileformat_test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assertEquals } from "https://deno.land/std@0.151.0/testing/asserts.ts";
1+
import { assertEquals } from "https://deno.land/std@0.159.0/testing/asserts.ts";
22
import { FileFormat, findFileFormat, splitText } from "./fileformat.ts";
33

44
Deno.test("splitText", async (t) => {

denops_std/bufname/bufname_test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {
22
assertEquals,
33
assertThrows,
4-
} from "https://deno.land/std@0.151.0/testing/asserts.ts";
5-
import * as path from "https://deno.land/std@0.151.0/path/mod.ts";
4+
} from "https://deno.land/std@0.159.0/testing/asserts.ts";
5+
import * as path from "https://deno.land/std@0.159.0/path/mod.ts";
66
import { format, parse } from "./bufname.ts";
77

88
Deno.test("format throws exception when 'scheme' contains unusable characters", () => {

denops_std/bufname/utils_test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assertEquals } from "https://deno.land/std@0.151.0/testing/asserts.ts";
1+
import { assertEquals } from "https://deno.land/std@0.159.0/testing/asserts.ts";
22
import { decode, encode } from "./utils.ts";
33

44
Deno.test("encode does nothing on alphabet characters", () => {

denops_std/function/_generated.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// NOTE: This file is generated. Do NOT modify it manually.
22
// deno-lint-ignore-file camelcase
3-
import type { Denops } from "https://deno.land/x/denops_core@v3.1.0/mod.ts";
3+
import type { Denops } from "https://deno.land/x/denops_core@v3.2.0/mod.ts";
44

55
/**
66
* Return the absolute value of {expr}. When {expr} evaluates to

denops_std/function/buffer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Denops } from "https://deno.land/x/denops_core@v3.1.0/mod.ts";
1+
import type { Denops } from "https://deno.land/x/denops_core@v3.2.0/mod.ts";
22

33
/**
44
* Add a buffer to the buffer list with {name}.

denops_std/function/common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Denops } from "https://deno.land/x/denops_core@v3.1.0/mod.ts";
1+
import type { Denops } from "https://deno.land/x/denops_core@v3.2.0/mod.ts";
22

33
/**
44
* The result is a Number, which is |TRUE| if {expr} is

denops_std/function/cursor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Denops } from "https://deno.land/x/denops_core@v3.1.0/mod.ts";
1+
import type { Denops } from "https://deno.land/x/denops_core@v3.2.0/mod.ts";
22
import type { Position, ScreenPos } from "./types.ts";
33

44
/**

denops_std/function/cursor_test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { assertEquals } from "https://deno.land/std@0.151.0/testing/asserts.ts";
1+
import { assertEquals } from "https://deno.land/std@0.159.0/testing/asserts.ts";
22
import { assertNumber } from "https://deno.land/x/unknownutil@v2.0.0/mod.ts";
3-
import { test } from "https://deno.land/x/denops_core@v3.1.0/test/mod.ts";
3+
import { test } from "https://deno.land/x/denops_core@v3.2.0/test/mod.ts";
44
import * as cursor from "./cursor.ts";
55
import { assertPosition, assertScreenPos, isScreenPos } from "./types.ts";
66

denops_std/function/input.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Denops } from "https://deno.land/x/denops_core@v3.1.0/mod.ts";
1+
import type { Denops } from "https://deno.land/x/denops_core@v3.2.0/mod.ts";
22
import { BuiltinCompletion, isValidBuiltinCompletion } from "./types.ts";
33

44
/**

denops_std/function/input_test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {
22
assertEquals,
33
assertRejects,
4-
} from "https://deno.land/std@0.151.0/testing/asserts.ts";
5-
import { test } from "https://deno.land/x/denops_core@v3.1.0/test/mod.ts";
4+
} from "https://deno.land/std@0.159.0/testing/asserts.ts";
5+
import { test } from "https://deno.land/x/denops_core@v3.2.0/test/mod.ts";
66
import { input, inputlist, inputsecret } from "./input.ts";
77
import * as autocmd from "../autocmd/mod.ts";
88
import { execute } from "../helper/execute.ts";

denops_std/function/nvim/_generated.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// NOTE: This file is generated. Do NOT modify it manually.
22
// deno-lint-ignore-file camelcase
3-
import type { Denops } from "https://deno.land/x/denops_core@v3.1.0/mod.ts";
3+
import type { Denops } from "https://deno.land/x/denops_core@v3.2.0/mod.ts";
44

55
/**
66
* Returns Dictionary of |api-metadata|.

0 commit comments

Comments
 (0)