Microsoft/TypeScript

JSDoc @type completion not working inside function argument

Open

#62,281 opened on 2025幎8月13日

GitHub で芋る
 (0 comments) (0 reactions) (0 assignees)TypeScript (6,726 forks)batch import
Domain: JSDocHelp WantedPossible Improvement

Repository metrics

Stars
 (48,455 stars)
PR merge metrics
 (平均マヌゞ 6d 17h) (30d で 9 merged PRs)

説明

🔎 Search Terms

jsdoc, completion

🕗 Version & Regression Information

Never seems to have worked

⏯ Playground Link

No response

💻 Code

JSDoc has some completion issues with completions like this:

function someFunc(/** @type {^cursor here^} **/) {}

❌ Does not work - @type completion (in function argument) from @import with named argument

///<reference path="fourslash.ts" />

// @allowJS: true
// @checkJs: true
// @module: esnext

// @filename: ./a.ts
////export interface ABC {}

// @filename: ./b.js
/////** @import * as t from "./a" */
////function someFunc(/** @type {t./**/} */arg) {}

verify.completions({
    marker: "",
    includes: "ABC",
});

✅ Works - @type completion (in function argument) from @typedef and with named argument

///<reference path="fourslash.ts" />

// @allowJS: true
// @checkJs: true
// @module: esnext

// @filename: ./b.js
/////** @typedef {number} SomeNumber */
////function someFunc(/** @type {S/**/} */arg) {}

verify.completions({
    marker: "",
    includes: "SomeNumber",
});

✅ Works - @type completion (not part of function argument) from @import completion inside

///<reference path="fourslash.ts" />

// @allowJS: true
// @checkJs: true
// @module: esnext

// @filename: ./a.ts
////export interface ABC {}

// @filename: ./b.js
/////** @import * as t from "./a" */
/////** @type {t./**/} */

verify.completions({
    marker: "",
    includes: "ABC",
});

❌ Does not work - @type completion (in function argument) from @import (argument not named yet)

///<reference path="fourslash.ts" />

// @allowJS: true
// @checkJs: true
// @module: esnext

// @filename: ./a.ts
////export interface ABC {}

// @filename: ./b.js
/////** @import * as t from "./a" */
////function someFunc(/** @type {t./**/} */) {}

verify.completions({
    marker: "",
    includes: "ABC",
});

❌ Does not work - @type completion (in function argument) @typedef (argument not named yet)

///<reference path="fourslash.ts" />

// @allowJS: true
// @checkJs: true
// @module: esnext

// @filename: ./b.js
/////** @typedef {number} SomeNumber */
////function someFunc(/** @type {S/**/} */) {}

verify.completions({
    marker: "",
    includes: "SomeNumber",
});

🙁 Actual behavior

See above, completions are missing.

🙂 Expected behavior

See above, completions are present.

Additional information about the issue

No response

コントリビュヌタヌガむド