Skip to content

JSDoc comment template incorrectly returned for element that already has JSDoc comment #47733

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

Closed
jespertheend opened this issue Jan 28, 2022 · 1 comment · Fixed by #47748
Closed
Labels
Bug A bug in TypeScript Domain: Completion Lists The issue relates to showing completion lists in an editor Domain: JSDoc Relates to JSDoc parsing and type generation Help Wanted You can do this
Milestone

Comments

@jespertheend
Copy link
Contributor

jespertheend commented Jan 28, 2022

TS Template added by @mjbvz

TypeScript Version: 4.6.0-dev.20220203

Search Terms

  • docCommentTemplate
  • jsdoc

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.63.2 as well as 1.64.0-insider
  • OS Version: macOS 12.1

Steps to Reproduce:

  1. Create a js function with parameters and include types via a JSDoc comment
  2. Create a new JSDoc comment above the other one and hit enter

For a demo of the issue, visit https://vscode.dev/github/jespertheend/vscode-jsdoc-autocomplete-bug and open jsdoc.js

Expected: No @param autocomplete
Actual: It completes with @param and @return inside the comment.

I'd expect comments to only autocomplete like this if a function is directly below it. Though I suppose autocomplete could be useful for overloading functions, this is not supported in TypeScript right now (see #25590).

@mjbvz mjbvz transferred this issue from microsoft/vscode Feb 4, 2022
@mjbvz mjbvz changed the title JSDoc autocompletes with @param when it shouldn't JSDoc comment template incorrectly returned for element that already has JSDoc comment Feb 4, 2022
@mjbvz
Copy link
Contributor

mjbvz commented Feb 4, 2022

Inline repo using VS Code :

/** */ 

/**
 * @param {FooObj} a
 * @param {FooObj} b
 */
 function foo(a, b) {
    return a.num + b.num;
}
  1. Trigger suggestions inside /** */

Bug
docCommentTemplate returns the template for foo

@mjbvz mjbvz removed their assignment Feb 4, 2022
@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Domain: Completion Lists The issue relates to showing completion lists in an editor Domain: JSDoc Relates to JSDoc parsing and type generation labels Feb 4, 2022
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Feb 4, 2022
@RyanCavanaugh RyanCavanaugh added the Help Wanted You can do this label Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Completion Lists The issue relates to showing completion lists in an editor Domain: JSDoc Relates to JSDoc parsing and type generation Help Wanted You can do this
Projects
None yet
3 participants