Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions autoload/denops/_internal/server/proc.vim
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const s:SCRIPT = denops#_internal#path#script(['@denops-private', 'cli.ts'])
const s:CONFIG = denops#_internal#path#script(['@denops-private', 'deno.jsonc'])

let s:job = v:null
let s:stopped_on_purpose = 0
Expand Down Expand Up @@ -47,6 +48,8 @@ function! s:start(options) abort
let l:args = [g:denops#server#deno, 'run']
let l:args += g:denops#server#deno_args
let l:args += [
\ '--config',
\ s:CONFIG,
\ s:SCRIPT,
\ '--quiet',
\ '--identity',
Expand Down
24 changes: 17 additions & 7 deletions deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
{
"workspace": [
"denops/@denops-private"
],
"tasks": {
"check": "deno check **/*.ts",
"check:doc": "deno test --doc --no-run",
"test": "LANG=C deno test -A --parallel --shuffle",
"test:coverage": "deno task test --coverage=.coverage",
"coverage": "deno coverage --exclude=\"test[.]ts(#.*)?$\" .coverage",
// NOTE: `--ignore @std/internal` is required to preserve test fixture.
"update": "deno run --allow-env --allow-read --allow-write --allow-run=git,deno --allow-net=jsr.io,registry.npmjs.org jsr:@molt/cli --no-lock --ignore @std/internal **/*.ts",
"update:write": "deno task -q update --write",
"update:commit": "deno task -q update --commit --prefix :package: --pre-commit=fmt,lint",
"coverage": "deno coverage --exclude=\"test[.]ts(#.*)?$\" --exclude=\"/tests/\" --exclude=\"import_map_importer\" .coverage",
"update": "deno outdated --update --latest --recursive",
"update:interactive": "deno task update -- --interactive",
Comment on lines +11 to +12
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Avoid self-referential task invocation

update:interactive shells out to deno task update, which is fine, but you
can call deno outdated directly and forward the extra flag to simplify the
indirection:

-    "update:interactive": "deno task update -- --interactive",
+    "update:interactive": "deno outdated --update --latest --recursive --interactive",

Fewer layers → easier to debug.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"update": "deno outdated --update --latest --recursive",
"update:interactive": "deno task update -- --interactive",
"update": "deno outdated --update --latest --recursive",
"update:interactive": "deno outdated --update --latest --recursive --interactive",
🤖 Prompt for AI Agents
In deno.jsonc around lines 11 to 12, the "update:interactive" task currently
calls "deno task update" which then calls "deno outdated". To simplify and
reduce indirection, modify "update:interactive" to call "deno outdated" directly
with the "--update --latest --recursive --interactive" flags, forwarding the
interactive flag directly. This reduces layers and makes debugging easier.

"apply:supported-versions": "deno run --allow-read --allow-write .scripts/apply_supported_versions.ts"
},
"exclude": [
".coverage/",
"tests/denops/testdata/no_check/",
"tests/denops/testdata/with_import_map/"
],
// NOTE: Import maps should only be used from test modules.
"imports": {
"/denops-private/": "./denops/@denops-private/",
"/denops-testdata/": "./tests/denops/testdata/",
"/denops-testutil/": "./tests/denops/testutil/"
"/denops-testutil/": "./tests/denops/testutil/",
"@core/asyncutil": "jsr:@core/asyncutil@^1.1.1",
"@core/streamutil": "jsr:@core/streamutil@^1.0.0",
"@denops/core": "jsr:@denops/core@^7.0.0",
"@milly/streams": "jsr:@milly/streams@^1.0.0",
"@nick/dispose": "jsr:@nick/dispose@^1.1.0",
"@std/assert": "jsr:@std/assert@^1.0.1",
"@std/async": "jsr:@std/async@^1.0.1",
"@std/path": "jsr:@std/path@^1.0.2",
"@std/testing": "jsr:@std/testing@^1.0.0",
"sinon": "npm:sinon@^21.0.0"
}
}
8 changes: 4 additions & 4 deletions denops/@denops-private/cli.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {
readableStreamFromWorker,
writableStreamFromWorker,
} from "jsr:@lambdalisue/workerio@^4.0.1";
import { deadline } from "jsr:@std/async@^1.0.1/deadline";
import { parseArgs } from "jsr:@std/cli@^1.0.1/parse-args";
import { asyncSignal } from "jsr:@milly/async-signal@^1.0.0";
} from "@lambdalisue/workerio";
import { deadline } from "@std/async/deadline";
import { parseArgs } from "@std/cli/parse-args";
import { asyncSignal } from "@milly/async-signal";

const WORKER_SCRIPT = import.meta.resolve("./worker.ts");
const WORKER_CLOSE_TIMEOUT_MS = 5000;
Expand Down
12 changes: 6 additions & 6 deletions denops/@denops-private/cli_test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// NOTE: Use sinon to stub the getter property.
// @deno-types="npm:@types/sinon@^17.0.3"
import sinon from "npm:sinon@^21.0.0";
import sinon from "sinon";

import {
assertEquals,
assertMatch,
assertNotMatch,
assertStringIncludes,
} from "jsr:@std/assert@^1.0.1";
} from "@std/assert";
Comment on lines 5 to +10
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Collapse multiline imports to restore formatter compliance

Same Prettier rule applies here – keep imports on one line.

-import {
-  assertEquals,
-  assertMatch,
-  assertNotMatch,
-  assertStringIncludes,
-} from "@std/assert";
+import { assertEquals, assertMatch, assertNotMatch, assertStringIncludes } from "@std/assert";

-import {
-  assertSpyCallArgs,
-  assertSpyCalls,
-  resolvesNext,
-  returnsNext,
-  spy,
-  type Stub,
-  stub,
-} from "@std/testing/mock";
+import { assertSpyCallArgs, assertSpyCalls, resolvesNext, returnsNext, spy, type Stub, stub } from "@std/testing/mock";

Also applies to: 12-19

🤖 Prompt for AI Agents
In denops/@denops-private/cli_test.ts between lines 5 and 10 (and also lines 12
to 19), the multiline import statements violate the Prettier formatting rules.
Collapse these multiline imports into single-line imports to restore formatter
compliance, ensuring all imported items from the same module are listed on one
line.

import {
assertSpyCallArgs,
assertSpyCalls,
Expand All @@ -16,10 +16,10 @@ import {
spy,
type Stub,
stub,
} from "jsr:@std/testing@^1.0.0/mock";
import { FakeTime } from "jsr:@std/testing@^1.0.0/time";
import { delay } from "jsr:@std/async@^1.0.1/delay";
import { flushPromises, peekPromiseState } from "jsr:@core/asyncutil@^1.1.1";
} from "@std/testing/mock";
import { FakeTime } from "@std/testing/time";
import { delay } from "@std/async/delay";
import { flushPromises, peekPromiseState } from "@core/asyncutil";
import {
createFakeTcpConn,
createFakeTcpListener,
Expand Down
19 changes: 19 additions & 0 deletions denops/@denops-private/deno.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"imports": {
"@core/asyncutil": "jsr:@core/asyncutil@^1.1.1",
"@core/errorutil": "jsr:@core/errorutil@^1.2.1",
"@core/unknownutil": "jsr:@core/unknownutil@^4.0.0",
"@denops/core": "jsr:@denops/core@^7.0.0",
"@denops/vim-channel-command": "jsr:@denops/vim-channel-command@^4.0.2",
"@lambdalisue/import-map-importer": "jsr:@lambdalisue/import-map-importer@^0.4.0",
"@lambdalisue/messagepack": "jsr:@lambdalisue/messagepack@^1.0.1",
"@lambdalisue/messagepack-rpc": "jsr:@lambdalisue/messagepack-rpc@^2.4.1",
"@lambdalisue/workerio": "jsr:@lambdalisue/workerio@^4.0.1",
"@milly/async-signal": "jsr:@milly/async-signal@^1.0.0",
"@nick/dispose": "jsr:@nick/dispose@^1.1.0",
"@std/async": "jsr:@std/async@^1.0.1",
"@std/cli": "jsr:@std/cli@^1.0.1",
"@std/path": "jsr:@std/path@^1.0.2",
"@std/semver": "jsr:@std/semver@^1.0.1"
}
}
10 changes: 5 additions & 5 deletions denops/@denops-private/denops.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import {
type Denops,
type Dispatcher,
type Meta,
} from "jsr:@denops/core@^7.0.0";
import { ensure } from "jsr:@core/unknownutil@^4.0.0/ensure";
import { isTupleOf } from "jsr:@core/unknownutil@^4.0.0/is/tuple-of";
import { isArray } from "jsr:@core/unknownutil@^4.0.0/is/array";
import { isString } from "jsr:@core/unknownutil@^4.0.0/is/string";
} from "@denops/core";
import { ensure } from "@core/unknownutil/ensure";
import { isTupleOf } from "@core/unknownutil/is/tuple-of";
import { isArray } from "@core/unknownutil/is/array";
import { isString } from "@core/unknownutil/is/string";
import type { Host as HostOrigin } from "./host.ts";
import type { Service as ServiceOrigin } from "./service.ts";

Expand Down
8 changes: 4 additions & 4 deletions denops/@denops-private/denops_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BatchError, type Meta } from "jsr:@denops/core@^7.0.0";
import { BatchError, type Meta } from "@denops/core";
import {
assert,
assertEquals,
Expand All @@ -7,14 +7,14 @@ import {
assertRejects,
assertStrictEquals,
unimplemented,
} from "jsr:@std/assert@^1.0.1";
} from "@std/assert";
import {
assertSpyCallArgs,
assertSpyCalls,
resolvesNext,
stub,
} from "jsr:@std/testing@^1.0.0/mock";
import { flushPromises, peekPromiseState } from "jsr:@core/asyncutil@^1.1.1";
} from "@std/testing/mock";
import { flushPromises, peekPromiseState } from "@core/asyncutil";
import { DenopsImpl, type Host, type Service } from "./denops.ts";

type BatchReturn = [results: unknown[], errmsg: string];
Expand Down
4 changes: 2 additions & 2 deletions denops/@denops-private/error.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { isString } from "jsr:@core/unknownutil@^4.0.0/is/string";
import { isString } from "@core/unknownutil/is/string";
import {
fromErrorObject,
isErrorObject,
toErrorObject,
tryOr,
} from "jsr:@core/errorutil@^1.2.1";
} from "@core/errorutil";

export function errorSerializer(err: unknown): unknown {
if (err instanceof Error) {
Expand Down
4 changes: 2 additions & 2 deletions denops/@denops-private/error_test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert, assertEquals, assertInstanceOf } from "jsr:@std/assert@^1.0.1";
import { isString } from "jsr:@core/unknownutil@^4.0.0/is/string";
import { assert, assertEquals, assertInstanceOf } from "@std/assert";
import { isString } from "@core/unknownutil/is/string";
import { errorDeserializer, errorSerializer } from "./error.ts";

Deno.test("errorSerializer", async (t) => {
Expand Down
14 changes: 7 additions & 7 deletions denops/@denops-private/host.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { Predicate } from "jsr:@core/unknownutil@^4.0.0/type";
import { ensure } from "jsr:@core/unknownutil@^4.0.0/ensure";
import { asOptional } from "jsr:@core/unknownutil@^4.0.0/as/optional";
import { isArray } from "jsr:@core/unknownutil@^4.0.0/is/array";
import { isParametersOf } from "jsr:@core/unknownutil@^4.0.0/is/parameters-of";
import { isString } from "jsr:@core/unknownutil@^4.0.0/is/string";
import { isUnknown } from "jsr:@core/unknownutil@^4.0.0/is/unknown";
import type { Predicate } from "@core/unknownutil/type";
import { ensure } from "@core/unknownutil/ensure";
import { asOptional } from "@core/unknownutil/as/optional";
import { isArray } from "@core/unknownutil/is/array";
import { isParametersOf } from "@core/unknownutil/is/parameters-of";
import { isString } from "@core/unknownutil/is/string";
import { isUnknown } from "@core/unknownutil/is/unknown";
Comment on lines +1 to +7
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Confirm new bare-specifier aliases exist in the import map

All seven imports were switched from fully-qualified URLs to bare specifiers. If @core/unknownutil/ is not mapped in importMap (referenced via deno.jsonc or the CLI --import-map flag), every consumer of this file will fail to resolve these modules at runtime.

Run the following to ensure each specifier has a mapping:


🏁 Script executed:

#!/bin/bash
# Check that every bare-specifier seen in this file appears in the import map.
fd -I -t f -a -E node_modules --regex 'deno\.jsonc?$' \
| head -n 1 | while read -r map; do
  echo "Import map: $map"
  for s in '@core/unknownutil/type' \
           '@core/unknownutil/ensure' \
           '@core/unknownutil/as/optional' \
           '@core/unknownutil/is/array' \
           '@core/unknownutil/is/parameters-of' \
           '@core/unknownutil/is/string' \
           '@core/unknownutil/is/unknown'; do
    grep -q "\"$s\"" "$map" || echo "❌  missing mapping for $s"
  done
done

Length of output: 3026


Add missing @core/unknownutil aliases to deno.jsonc importMap

The seven bare-specifier imports added in denops/@denops-private/host.ts are not present in your import map and will fail at runtime. Please update deno.jsonc to include mappings for each of these:

• @core/unknownutil/type
• @core/unknownutil/ensure
• @core/unknownutil/as/optional
• @core/unknownutil/is/array
• @core/unknownutil/is/parameters-of
• @core/unknownutil/is/string
• @core/unknownutil/is/unknown

For example, under the "imports" section:

 {
   "imports": {
+    "@core/unknownutil/": "https://deno.land/x/unknownutil@<version>/",
     // …other mappings…
   }
 }

Or map each specifier individually if you prefer:

 {
   "imports": {
+    "@core/unknownutil/type":       "https://deno.land/x/unknownutil@<version>/type.ts",
+    "@core/unknownutil/ensure":     "https://deno.land/x/unknownutil@<version>/ensure.ts",
+    "@core/unknownutil/as/optional":"https://deno.land/x/unknownutil@<version>/as/optional.ts",
+    "@core/unknownutil/is/array":   "https://deno.land/x/unknownutil@<version>/is/array.ts",
+    "@core/unknownutil/is/parameters-of": "https://deno.land/x/unknownutil@<version>/is/parameters-of.ts",
+    "@core/unknownutil/is/string":  "https://deno.land/x/unknownutil@<version>/is/string.ts",
+    "@core/unknownutil/is/unknown": "https://deno.land/x/unknownutil@<version>/is/unknown.ts",
     // …other mappings…
   }
 }

Once these entries are added, rerun your tests to confirm everything resolves correctly at runtime.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In denops/@denops-private/host.ts lines 1 to 7, the imports from
@core/unknownutil aliases are missing in the deno.jsonc importMap, causing
runtime failures. To fix this, update the "imports" section of deno.jsonc to
include mappings for each of these specifiers: @core/unknownutil/type,
@core/unknownutil/ensure, @core/unknownutil/as/optional,
@core/unknownutil/is/array, @core/unknownutil/is/parameters-of,
@core/unknownutil/is/string, and @core/unknownutil/is/unknown. Add either a
combined mapping or individual entries for each specifier, then rerun tests to
ensure proper resolution.


/**
* Host (Vim/Neovim) which is visible from Service
Expand Down
16 changes: 8 additions & 8 deletions denops/@denops-private/host/nvim.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ensure } from "jsr:@core/unknownutil@^4.0.0/ensure";
import { isArray } from "jsr:@core/unknownutil@^4.0.0/is/array";
import { isNull } from "jsr:@core/unknownutil@^4.0.0/is/null";
import { isNumber } from "jsr:@core/unknownutil@^4.0.0/is/number";
import { isString } from "jsr:@core/unknownutil@^4.0.0/is/string";
import { isTupleOf } from "jsr:@core/unknownutil@^4.0.0/is/tuple-of";
import { isUnionOf } from "jsr:@core/unknownutil@^4.0.0/is/union-of";
import { Client, Session } from "jsr:@lambdalisue/messagepack-rpc@^2.4.1";
import { ensure } from "@core/unknownutil/ensure";
import { isArray } from "@core/unknownutil/is/array";
import { isNull } from "@core/unknownutil/is/null";
import { isNumber } from "@core/unknownutil/is/number";
import { isString } from "@core/unknownutil/is/string";
import { isTupleOf } from "@core/unknownutil/is/tuple-of";
import { isUnionOf } from "@core/unknownutil/is/union-of";
import { Client, Session } from "@lambdalisue/messagepack-rpc";
import { errorDeserializer, errorSerializer } from "../error.ts";
import { getVersionOr } from "../version.ts";
import { type Host, invoke, type Service } from "../host.ts";
Expand Down
12 changes: 6 additions & 6 deletions denops/@denops-private/host/nvim_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ import {
assertMatch,
assertRejects,
assertStringIncludes,
} from "jsr:@std/assert@^1.0.1";
} from "@std/assert";
import {
assertSpyCallArgs,
assertSpyCalls,
resolvesNext,
stub,
} from "jsr:@std/testing@^1.0.0/mock";
import { delay } from "jsr:@std/async@^1.0.1/delay";
import { peekPromiseState } from "jsr:@core/asyncutil@^1.1.1";
import { unimplemented } from "jsr:@core/errorutil@^1.2.1";
import { Client } from "jsr:@lambdalisue/messagepack-rpc@^2.4.1";
} from "@std/testing/mock";
Comment on lines 7 to +12
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Prettier violation – collapse @std/testing/mock import

-import {
-  assertSpyCallArgs,
-  assertSpyCalls,
-  resolvesNext,
-  stub,
-} from "@std/testing/mock";
+import { assertSpyCallArgs, assertSpyCalls, resolvesNext, stub } from "@std/testing/mock";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import {
assertSpyCallArgs,
assertSpyCalls,
resolvesNext,
stub,
} from "jsr:@std/testing@^1.0.0/mock";
import { delay } from "jsr:@std/async@^1.0.1/delay";
import { peekPromiseState } from "jsr:@core/asyncutil@^1.1.1";
import { unimplemented } from "jsr:@core/errorutil@^1.2.1";
import { Client } from "jsr:@lambdalisue/messagepack-rpc@^2.4.1";
} from "@std/testing/mock";
import { assertSpyCallArgs, assertSpyCalls, resolvesNext, stub } from "@std/testing/mock";
🤖 Prompt for AI Agents
In denops/@denops-private/host/nvim_test.ts around lines 7 to 12, the import
statement from "@std/testing/mock" is spread across multiple lines, violating
Prettier formatting rules. Collapse this import statement into a single line by
listing all imported members within one pair of curly braces on the same line to
comply with Prettier's style guidelines.

import { delay } from "@std/async/delay";
import { peekPromiseState } from "@core/asyncutil";
import { unimplemented } from "@core/errorutil";
import { Client } from "@lambdalisue/messagepack-rpc";
import { withNeovim } from "/denops-testutil/with.ts";
import type { Service } from "../host.ts";
import { Neovim } from "./nvim.ts";
Expand Down
18 changes: 7 additions & 11 deletions denops/@denops-private/host/vim.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import { ensure } from "jsr:@core/unknownutil@^4.0.0/ensure";
import { isArray } from "jsr:@core/unknownutil@^4.0.0/is/array";
import { isLiteralOf } from "jsr:@core/unknownutil@^4.0.0/is/literal-of";
import { isString } from "jsr:@core/unknownutil@^4.0.0/is/string";
import { isTupleOf } from "jsr:@core/unknownutil@^4.0.0/is/tuple-of";
import { isUnknown } from "jsr:@core/unknownutil@^4.0.0/is/unknown";
import {
Client,
type Message,
Session,
} from "jsr:@denops/vim-channel-command@^4.0.2";
import { ensure } from "@core/unknownutil/ensure";
import { isArray } from "@core/unknownutil/is/array";
import { isLiteralOf } from "@core/unknownutil/is/literal-of";
import { isString } from "@core/unknownutil/is/string";
import { isTupleOf } from "@core/unknownutil/is/tuple-of";
import { isUnknown } from "@core/unknownutil/is/unknown";
import { Client, type Message, Session } from "@denops/vim-channel-command";
import { type Host, invoke, type Service } from "../host.ts";

export class Vim implements Host {
Expand Down
16 changes: 6 additions & 10 deletions denops/@denops-private/host/vim_test.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import {
assertEquals,
assertMatch,
assertRejects,
} from "jsr:@std/assert@^1.0.1";
import { assertEquals, assertMatch, assertRejects } from "@std/assert";
import {
assertSpyCallArgs,
assertSpyCalls,
resolvesNext,
stub,
} from "jsr:@std/testing@^1.0.0/mock";
import { delay } from "jsr:@std/async@^1.0.1/delay";
import { peekPromiseState } from "jsr:@core/asyncutil@^1.1.1";
import { unimplemented } from "jsr:@core/errorutil@^1.2.1";
import { Client, Session } from "jsr:@denops/vim-channel-command@^4.0.2";
} from "@std/testing/mock";
import { delay } from "@std/async/delay";
import { peekPromiseState } from "@core/asyncutil";
import { unimplemented } from "@core/errorutil";
import { Client, Session } from "@denops/vim-channel-command";
import { withVim } from "/denops-testutil/with.ts";
import type { Service } from "../host.ts";
import { Vim } from "./vim.ts";
Expand Down
12 changes: 4 additions & 8 deletions denops/@denops-private/host_test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { assertThrows } from "jsr:@std/assert@^1.0.1";
import {
assertSpyCall,
assertSpyCalls,
stub,
} from "jsr:@std/testing@^1.0.0/mock";
import { AssertError } from "jsr:@core/unknownutil@^4.0.0/assert";
import { unimplemented } from "jsr:@core/errorutil@^1.2.1";
import { assertThrows } from "@std/assert";
import { assertSpyCall, assertSpyCalls, stub } from "@std/testing/mock";
import { AssertError } from "@core/unknownutil/assert";
import { unimplemented } from "@core/errorutil";
import { invoke, type Service } from "./host.ts";

Deno.test("invoke", async (t) => {
Expand Down
12 changes: 6 additions & 6 deletions denops/@denops-private/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { Denops, Entrypoint } from "jsr:@denops/core@^7.0.0";
import type { Denops, Entrypoint } from "@denops/core";
import {
type ImportMap,
ImportMapImporter,
loadImportMap,
} from "jsr:@lambdalisue/import-map-importer@^0.3.1";
import { toFileUrl } from "jsr:@std/path@^1.0.2/to-file-url";
import { fromFileUrl } from "jsr:@std/path@^1.0.2/from-file-url";
import { join } from "jsr:@std/path@^1.0.2/join";
import { dirname } from "jsr:@std/path@^1.0.2/dirname";
} from "@lambdalisue/import-map-importer";
import { toFileUrl } from "@std/path/to-file-url";
import { fromFileUrl } from "@std/path/from-file-url";
import { join } from "@std/path/join";
import { dirname } from "@std/path/dirname";

type PluginModule = {
main: Entrypoint;
Expand Down
15 changes: 5 additions & 10 deletions denops/@denops-private/plugin_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,11 @@ import {
assertInstanceOf,
assertRejects,
assertStringIncludes,
} from "jsr:@std/assert@^1.0.1";
import {
assertSpyCall,
assertSpyCalls,
spy,
stub,
} from "jsr:@std/testing@^1.0.0/mock";
import type { Denops, Meta } from "jsr:@denops/core@^7.0.0";
import { flushPromises } from "jsr:@core/asyncutil@^1.1.1";
import { unimplemented } from "jsr:@core/errorutil@^1.2.1";
} from "@std/assert";
import { assertSpyCall, assertSpyCalls, spy, stub } from "@std/testing/mock";
import type { Denops, Meta } from "@denops/core";
import { flushPromises } from "@core/asyncutil";
import { unimplemented } from "@core/errorutil";
import { resolveTestDataURL } from "/denops-testdata/resolve.ts";
import { Plugin } from "./plugin.ts";

Expand Down
4 changes: 2 additions & 2 deletions denops/@denops-private/service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta } from "jsr:@denops/core@^7.0.0";
import { toErrorObject } from "jsr:@core/errorutil@^1.2.1";
import type { Meta } from "@denops/core";
import { toErrorObject } from "@core/errorutil";
import { DenopsImpl, type Host } from "./denops.ts";
import type { CallbackId, Service as HostService } from "./host.ts";
import { Plugin } from "./plugin.ts";
Expand Down
12 changes: 6 additions & 6 deletions denops/@denops-private/service_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ import {
assertRejects,
assertStrictEquals,
assertStringIncludes,
} from "jsr:@std/assert@^1.0.1";
} from "@std/assert";
import {
assertSpyCall,
assertSpyCalls,
resolvesNext,
spy,
stub,
} from "jsr:@std/testing@^1.0.0/mock";
import { toFileUrl } from "jsr:@std/path@^1.0.2/to-file-url";
import type { Meta } from "jsr:@denops/core@^7.0.0";
import { flushPromises, peekPromiseState } from "jsr:@core/asyncutil@^1.1.1";
import { unimplemented } from "jsr:@core/errorutil@^1.2.1";
} from "@std/testing/mock";
import { toFileUrl } from "@std/path/to-file-url";
import type { Meta } from "@denops/core";
import { flushPromises, peekPromiseState } from "@core/asyncutil";
import { unimplemented } from "@core/errorutil";
import { INVALID_PLUGIN_NAMES } from "/denops-testdata/invalid_plugin_names.ts";
import { resolveTestDataURL } from "/denops-testdata/resolve.ts";
import type { Host } from "./denops.ts";
Expand Down
10 changes: 5 additions & 5 deletions denops/@denops-private/util.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Meta } from "jsr:@denops/core@^7.0.0";
import type { Predicate } from "jsr:@core/unknownutil@^4.0.0/type";
import { isLiteralOneOf } from "jsr:@core/unknownutil@^4.0.0/is/literal-one-of";
import { isObjectOf } from "jsr:@core/unknownutil@^4.0.0/is/object-of";
import { isString } from "jsr:@core/unknownutil@^4.0.0/is/string";
import type { Meta } from "@denops/core";
import type { Predicate } from "@core/unknownutil/type";
import { isLiteralOneOf } from "@core/unknownutil/is/literal-one-of";
import { isObjectOf } from "@core/unknownutil/is/object-of";
import { isString } from "@core/unknownutil/is/string";
Comment on lines +1 to +5
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Confirm import-map covers all @core/unknownutil aliases

These paths (@core/unknownutil/...) are no longer version-pinned, so compile
success now depends on matching entries in the new import map. Double-check
that each sub-module is mapped, otherwise editors and CI will fail to resolve
them.


🏁 Script executed:

#!/bin/bash
# Show import-map entries for unknownutil
jq '.imports' deno.jsonc | rg unknownutil

Length of output: 107


Couldn’t parse the import map with jq (due to JSONC syntax). Let’s directly grep the file for those aliases:

This will show whether each sub-module alias is present. If nothing appears, please verify the import-map manually.


🏁 Script executed:

#!/bin/bash
# List all @core/unknownutil entries in deno.jsonc
rg -n '"@core/unknownutil/' deno.jsonc

Length of output: 40


Let’s parse the JSONC import map (stripping comments) and list all import aliases to check for @core/unknownutil entries:


🏁 Script executed:

#!/bin/bash
# Install JSONC parser and dump import-map keys
pip install commentjson >/dev/null 2>&1
python3 - << 'EOF'
import commentjson
with open("deno.jsonc") as f:
    data = commentjson.load(f)
for key in data.get("imports", {}):
    print(key)
EOF

Length of output: 217


Add missing @core/unknownutil import-map entries

The deno.jsonc import map currently has no entries for any @core/unknownutil paths, so these imports in denops/@denops-private/util.ts will fail to resolve:

  • @core/unknownutil/type
  • @core/unknownutil/is/literal-one-of
  • @core/unknownutil/is/object-of
  • @core/unknownutil/is/string

Please update the "imports" section in deno.jsonc—for example, using a wildcard—to cover all submodules:

 deno.jsonc
 "imports": {
+  "@core/unknownutil/": "https://deno.land/x/unknownutil@<version>/",
   "/denops-private/":    "./denops/@denops-private/",
   "/denops-testdata/":   "./tests/denops/runtime/testdata/",
   ...
 }

Ensure the version matches your unknownutil release so that all these subpaths resolve correctly.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import type { Meta } from "@denops/core";
import type { Predicate } from "@core/unknownutil/type";
import { isLiteralOneOf } from "@core/unknownutil/is/literal-one-of";
import { isObjectOf } from "@core/unknownutil/is/object-of";
import { isString } from "@core/unknownutil/is/string";
// deno.jsonc
{
"imports": {
"@core/unknownutil/": "https://deno.land/x/unknownutil@<version>/",
"/denops-private/": "./denops/@denops-private/",
"/denops-testdata/": "./tests/denops/runtime/testdata/",
...
}
}
🤖 Prompt for AI Agents
In denops/@denops-private/util.ts lines 1 to 5, the imports from
@core/unknownutil submodules will fail because deno.jsonc lacks corresponding
import-map entries. To fix this, update the "imports" section in deno.jsonc to
include entries for @core/unknownutil paths, ideally using a wildcard pattern
like "@core/unknownutil/": "path_to_unknownutil_version/" to cover all
submodules. Make sure the version or path matches your installed unknownutil
release so these imports resolve correctly.


export const isMeta: Predicate<Meta> = isObjectOf({
mode: isLiteralOneOf(["release", "debug", "test"] as const),
Expand Down
Loading
Loading