Microsoft/TypeScript
View on GitHubJSDoc @type completion not working inside function argument
Open
#62,281 opened on Aug 13, 2025
Domain: JSDocHelp WantedPossible Improvement
Description
๐ 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