Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support jsdocs overloading #46166

Closed
OhadBaehr opened this issue Oct 1, 2021 · 1 comment
Closed

Support jsdocs overloading #46166

OhadBaehr opened this issue Oct 1, 2021 · 1 comment
Labels
Domain: JSDoc Relates to JSDoc parsing and type generation Duplicate An existing issue was already created

Comments

@OhadBaehr
Copy link

/**
* 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.

@mjbvz mjbvz transferred this issue from microsoft/vscode Oct 1, 2021
@mjbvz
Copy link
Contributor

mjbvz commented Oct 1, 2021

Duplicate of #25590

@mjbvz mjbvz marked this as a duplicate of #25590 Oct 1, 2021
@mjbvz mjbvz closed this as completed Oct 1, 2021
@mjbvz mjbvz added Domain: JSDoc Relates to JSDoc parsing and type generation Duplicate An existing issue was already created labels Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: JSDoc Relates to JSDoc parsing and type generation Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants