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

TypeScript "TSDoc" does not support "@return" used in function comments #7073

Open
captain-something opened this issue Mar 10, 2025 · 0 comments

Comments

@captain-something
Copy link

captain-something commented Mar 10, 2025

I noticed in VSCode some math functions were not telling me if the returned answer was going to be in radians or degrees, and finally thought I'd set up a PR to add that information. When I dived into the JavaScript I saw that you have actually documented this - Intellisense was never receiving the information because of a subtle difference between JSDoc and TSDoc:

/**
 * Find the angle of a segment from (x1, y1) -> (x2, y2).
 *
 * @function Phaser.Math.Angle.Between
 * @since 3.0.0
 *
 * @param {number} x1 - The x coordinate of the first point.
 * @param {number} y1 - The y coordinate of the first point.
 * @param {number} x2 - The x coordinate of the second point.
 * @param {number} y2 - The y coordinate of the second point.
 *
 * @return {number} The angle in radians. 
 */

in phaser.d.ts this reduces to:

/**
 * Find the angle of a segment from (x1, y1) -> (x2, y2).
 * @param x1 The x coordinate of the first point.
 * @param y1 The y coordinate of the first point.
 * @param x2 The x coordinate of the second point.
 * @param y2 The y coordinate of the second point.
 */
function Between(x1: number, y1: number, x2: number, y2: number): number;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant