Skip to content

Commit 4d24486

Browse files
authored
Merge pull request #289 from vim-denops/bump-supported-versions
Update supported versions
2 parents 97ebc4d + 504bc8e commit 4d24486

28 files changed

+4469
-1530
lines changed

.github/workflows/test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
runner:
3838
- ubuntu-latest
3939
deno_version:
40-
- "1.x"
40+
- "2.x"
4141
runs-on: ${{ matrix.runner }}
4242
steps:
4343
- run: git config --global core.autocrlf false
@@ -77,11 +77,11 @@ jobs:
7777
- macos-latest
7878
- ubuntu-latest
7979
deno_version:
80-
- "1.45.0"
81-
- "1.x"
80+
- "2.3.0"
81+
- "2.x"
8282
host_version:
83-
- vim: "v9.1.0448"
84-
nvim: "v0.10.0"
83+
- vim: "v9.1.1646"
84+
nvim: "v0.11.3"
8585
runs-on: ${{ matrix.runner }}
8686
timeout-minutes: 15
8787
steps:

.scripts/apply-supported-versions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
} from "./supported_versions.ts";
55

66
async function main(): Promise<void> {
7-
const supportedVersions = await loadSupportedVersions("main");
7+
const supportedVersions = await loadSupportedVersions();
88
await updateREADME(supportedVersions);
99
await updateGithubWorkflowsTest(supportedVersions);
1010
}

.scripts/gen-function/format.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const translate: Record<string, string> = {
1818
"lnum-end": "lnum_end",
1919
"instanceof": "instanceof_",
2020
"class": "class_",
21+
"package": "package_",
2122
};
2223

2324
export function formatDocs(docs: string): string[] {

.scripts/gen-function/gen-function.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,26 @@ const vimHelpDownloadUrls = [
4141
`https://raw.githubusercontent.com/vim/vim/v${VIM_VERSION}/runtime/doc/testing.txt`,
4242
`https://raw.githubusercontent.com/vim/vim/v${VIM_VERSION}/runtime/doc/textprop.txt`,
4343
];
44-
for (const vimHelpDownloadUrl of vimHelpDownloadUrls) {
45-
console.log(`Download from ${vimHelpDownloadUrl}`);
46-
}
4744
const vimHelps = await Promise.all(vimHelpDownloadUrls.map(downloadString));
4845
const vimDefs = parse(vimHelps.join("\n"));
4946
const vimFnSet = new Set(vimDefs.map((def) => def.fn)).difference(manualFnSet);
5047

5148
const nvimHelpDownloadUrls = [
5249
`https://raw.githubusercontent.com/neovim/neovim/v${NVIM_VERSION}/runtime/doc/api.txt`,
53-
`https://raw.githubusercontent.com/neovim/neovim/v${NVIM_VERSION}/runtime/doc/builtin.txt`,
54-
`https://raw.githubusercontent.com/neovim/neovim/v${NVIM_VERSION}/runtime/doc/eval.txt`,
50+
[
51+
`https://raw.githubusercontent.com/neovim/neovim/v${NVIM_VERSION}/runtime/doc/builtin.txt`,
52+
// Neovim 0.11+ removed "builtin.txt", but "vimfn.txt" seems to be equivalent.
53+
// https://github.com/neovim/neovim/pull/24493
54+
`https://raw.githubusercontent.com/neovim/neovim/v${NVIM_VERSION}/runtime/doc/vimfn.txt`,
55+
],
56+
[
57+
`https://raw.githubusercontent.com/neovim/neovim/v${NVIM_VERSION}/runtime/doc/eval.txt`,
58+
// Neovim 0.11+ removed "eval.txt", but "vimeval.txt" seems to be equivalent.
59+
// https://github.com/neovim/neovim/pull/24493
60+
`https://raw.githubusercontent.com/neovim/neovim/v${NVIM_VERSION}/runtime/doc/vimeval.txt`,
61+
],
5562
`https://raw.githubusercontent.com/neovim/neovim/v${NVIM_VERSION}/runtime/doc/sign.txt`,
5663
];
57-
for (const nvimHelpDownloadUrl of nvimHelpDownloadUrls) {
58-
console.log(`Download from ${nvimHelpDownloadUrl}`);
59-
}
6064
const nvimHelps = await Promise.all(nvimHelpDownloadUrls.map(downloadString));
6165
const nvimDefs = parse(nvimHelps.join("\n"));
6266
const nvimFnSet = new Set(nvimDefs.map((def) => def.fn)).difference(

.scripts/utils.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,20 @@ import { toText } from "@std/streams/to-text";
44
* Downloads a text file and returns the contents.
55
* Throws error if fetch fails.
66
*/
7-
export async function downloadString(url: string): Promise<string> {
8-
const response = await fetch(url);
9-
if (response.status >= 400 || !response.body) {
10-
throw new Error(`Failed to read ${url}`);
7+
export async function downloadString(urls: string | string[]): Promise<string> {
8+
urls = Array.isArray(urls) ? urls : [urls];
9+
for (const url of urls) {
10+
console.log(`Download from ${url}`);
11+
const response = await fetch(url);
12+
if (response.status >= 400 || !response.body) {
13+
console.debug(
14+
`Failed to download ${url}. Fallback to next URL if exists.`,
15+
);
16+
continue;
17+
}
18+
return await toText(response.body);
1119
}
12-
return await toText(response.body);
20+
throw new Error(`Failed to download from ${urls.join(", ")}`);
1321
}
1422

1523
/**

.scripts/utils_test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ Deno.test(downloadString.name, async (t) => {
4747

4848
await t.step("Throws error if fetch fails", async () => {
4949
const url = "https://example.net/foo.ts";
50-
const expectedMessage = "Failed to read https://example.net/foo.ts";
50+
const expectedMessage =
51+
"Failed to download from https://example.net/foo.ts";
5152
await mockFetch({
5253
init: { status: 404 },
5354
async fn() {

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
[![Test](https://github.com/vim-denops/deno-denops-std/actions/workflows/test.yml/badge.svg)](https://github.com/vim-denops/deno-denops-std/actions/workflows/test.yml)
55
[![codecov](https://codecov.io/github/vim-denops/deno-denops-std/branch/main/graph/badge.svg?token=RKAZMUQ3D9)](https://codecov.io/github/vim-denops/deno-denops-std)
66

7-
[![Deno 1.45.0 or above](https://img.shields.io/badge/Deno-Support%201.45.0-yellowgreen.svg?logo=deno)](https://github.com/denoland/deno/tree/v1.45.0)
8-
[![Vim 9.1.0448 or above](https://img.shields.io/badge/Vim-Support%209.1.0448-yellowgreen.svg?logo=vim)](https://github.com/vim/vim/tree/v9.1.0448)
9-
[![Neovim 0.10.0 or above](https://img.shields.io/badge/Neovim-Support%200.10.0-yellowgreen.svg?logo=neovim&logoColor=white)](https://github.com/neovim/neovim/tree/v0.10.0)
7+
[![Deno 2.3.0 or above](https://img.shields.io/badge/Deno-Support%202.3.0-yellowgreen.svg?logo=deno)](https://github.com/denoland/deno/tree/v2.3.0)
8+
[![Vim 9.1.1646 or above](https://img.shields.io/badge/Vim-Support%209.1.1646-yellowgreen.svg?logo=vim)](https://github.com/vim/vim/tree/v9.1.1646)
9+
[![Neovim 0.11.3 or above](https://img.shields.io/badge/Neovim-Support%200.11.3-yellowgreen.svg?logo=neovim&logoColor=white)](https://github.com/neovim/neovim/tree/v0.11.3)
1010

1111
Standard module for [denops.vim].
1212

buffer/decoration.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,14 +261,16 @@ async function nvimDecorate(
261261
for (const chunk of itertools.chunked(decorations, 1000)) {
262262
await batch(denops, async (denops) => {
263263
for (const deco of chunk) {
264-
await nvimFn.nvim_buf_add_highlight(
264+
await nvimFn.nvim_buf_set_extmark(
265265
denops,
266266
bufnr,
267267
ns,
268-
deco.highlight,
269268
deco.line - 1,
270269
deco.column - 1,
271-
deco.column - 1 + deco.length,
270+
{
271+
end_col: deco.column - 1 + deco.length,
272+
hl_group: deco.highlight,
273+
},
272274
);
273275
}
274276
});

deno.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,6 @@
103103
"gen:function": "deno run -A ./.scripts/gen-function/gen-function.ts",
104104
"gen:option": "deno run -A ./.scripts/gen-option/gen-option.ts",
105105
"gen": "deno task gen:function && deno task gen:option && deno fmt",
106-
"apply:supported-versions": "deno run --allow-net --allow-read --allow-write .scripts/apply-supported-versions.ts"
106+
"apply:supported-versions": "deno run --allow-net --allow-read --allow-write --allow-env .scripts/apply-supported-versions.ts"
107107
}
108108
}

0 commit comments

Comments
 (0)