Skip to content

VSCode intellisense doesnt recognize @throws type in JSDoc #50998

Closed
@TrevorSlobodnick

Description

@TrevorSlobodnick

Type: Feature Request

  • Create and open a javascript file
  • Write a function that throws an error
  • Add a comment above the function using the format
    * @throws {AnyError} Throws an error

When hovering over the function, you can see the literal text "@throws --- {AnyError} Throws an error" while I expected to see something more like "@throws --- Throws an error".

I was expecting @throws to work the same way @param and @returns do, Where if you provide a type, VSCode will recognize it, remove it from the description when the function is hovered, and be able to use that information in my code (Whenever the function is called, it should show some kind of alert to wrap it in a try/catch)

VS Code version: Code 1.71.2 (74b1f979648cc44d385a2286793c226e611f59e7, 2022-09-14T21:03:37.738Z)
OS version: Windows_NT x64 10.0.19044
Modes:
Sandboxed: No

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions