Closed
Description
/**
* move to coords
*
* @param {number} x X coordinate
* @param {number} y Y coordinate
* @param {object} [opts] options
* @param {boolean} [opts.opt1] option 1
* @param {number} [opts.opt2] option 2
*//**
* move to point
*
* @param {object} target point struct
* @param {object} [opts] options
* @param {boolean} [opts.opt1] option 1
* @param {number} [opts.opt2] option 2
*/
function move(arg1, arg2, arg3) {
let x, y, opts;
if (typeof arg1 === "object") {
x = arg1.x;
y = arg1.y;
opts = arg2;
} else {
x = arg1;
y = arg2;
opts = arg3;
}
// do some stuff
}
move(1, 2, {opt1: true});
move({x: 1, y: 2}, {opt1: true});
This code should have 2 overload options, VSCode only picks one.
Please make it possible to have function overloading using JSDocs.