# JSDoc comments

> **TL;DR**
> Required plugin:
>
>
>
> `JavaScript and TypeScript`:   the plugin is bundled with IntelliJ IDEA and enabled by default.

IntelliJ IDEA recognizes [JSDoc comments](https://jsdoc.app/) and helps you create them by automatically inserting `@param`, `@returns`, `@private`, and other tags when you type the opening block comment `/**` and press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (NetBeans), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (Eclipse), `⏎` (Eclipse (macOS)). JSDoc comments are used for documentation lookup with `Ctrl+Q` (Windows), `F1` (macOS), `⌃ J` (IntelliJ IDEA Classic (macOS)), `⌘ I` (macOS System Shortcuts), `Ctrl+Q` (XWin), `Ctrl+Q` (GNOME), `Ctrl+Q` (KDE), `Ctrl+Q` (Emacs), `Ctrl+Q` (Sublime Text), `Ctrl+Q` (Sublime Text (macOS)), `Ctrl+Q` (NetBeans), `Ctrl+K, I` (Visual Studio), `⌘ K, I` (Visual Studio (macOS)), `Alt+Middle-Click` (Eclipse), `⌥ Middle-Click` (Eclipse (macOS)) in JavaScript and TypeScript, see [JavaScript documentation look-up](viewing-javascript-reference.html#view) and [TypeScript documentation
look-up](typescript-support.html#ws_ts_documentation_look_up), as well as for [type
annotations](javascript-specific-guidelines.html#ws_js_type_hints) and [method return type hints](javascript-specific-guidelines.html#ws_js_return_type_hints) in chained methods.

IntelliJ IDEA also recognizes [TODO patterns](using-todo.html), [Closure Compiler](https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler) annotations, and [TypeScript syntax](#ws_js_jsdoc_typescript_syntax) inside documentation comments and uses them in code completion, intention actions, and other types of coding assistance.

Find a detailed description of the JSDoc syntax with examples  in [Getting Started with JSDoc](https://jsdoc.app/about-getting-started.html) and [JSDoc supported types](https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html).

## Create JSDoc comments

Procedure:

* Place the caret before the declaration of the method/function or field to document, type the opening block comment `/**`, and press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (NetBeans), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (Eclipse), `⏎` (Eclipse (macOS)).

IntelliJ IDEA generates a JSDoc comment with a list of parameters (`@param`) and return values (`@returns`), where applicable. Describe the listed parameters, return values, and so on.

![Generate jsdoc comment](https://resources.jetbrains.com.cn/help/img/idea/2026.2/ws_insert_jsdoc_comment.animated.gif)

> **Tip:**
> To turn off automatic generation of JSDoc comments,   open the Settings dialog (`Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS))), go to `Editor | General | Smart Keys`, and clear the Insert documentation comment stub checkbox in the Enter area.

* Alternatively, use the dedicated Fix Doc Comment action. Place the caret at the method/function or field to document, press `Ctrl+Shift+A` (Windows), `⌘ ⇧ A` (macOS), `⌘ ⇧ A` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ P` (macOS System Shortcuts), `Ctrl+Shift+A` (XWin), `Ctrl+Shift+A` (GNOME), `Ctrl+Shift+A` (KDE), `Escape, X` (Emacs), `Ctrl+Shift+P` (Sublime Text), `⌘ ⇧ P` (Sublime Text (macOS)), `Ctrl+I` (NetBeans), `Ctrl+Shift+A` (Visual Studio), `⌘ ⇧ A` (Visual Studio (macOS)), `Ctrl+Shift+A` (Eclipse), `⌘ 3` (Eclipse (macOS)) and start typing `Fix Doc Comment`. Then select Fix Doc Comment from the list, and press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (NetBeans), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (Eclipse), `⏎` (Eclipse (macOS)).

## TypeScript syntax in JSDoc comments

You can use TypeScript annotations, for example, `@type` or `@typedef`, within JSDoc comments in JavaScript files. IntelliJ IDEA recognizes TypeScript syntax constructs, for example, [union types](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types) or optional properties in `@typedef` declarations.

IntelliJ IDEA provides code completion for TypeScript annotations.

![Code completion for TypeScript annotations within JSDoc in a JavaScript file](https://resources.jetbrains.com.cn/help/img/idea/2026.2/ws_jsdoc_ts_syntax_completion.png)

Based on `@type` annotations, IntelliJ IDEA shows parameter hints.

![Parameter hints are shown based on type annotations within JSDoc in a JavaScript file](https://resources.jetbrains.com.cn/help/img/idea/2026.2/ws_jsdoc_ts_syntax_parameter_hints.png)

> **Note:**
> Mixed types are also supported. However, when JSDoc and TypeScript syntax are in contradiction, IntelliJ IDEA uses JSDoc syntax.

## View JSDoc comments rendered in the editor

With IntelliJ IDEA, JSDoc comments can be shown in an easier-to-read format. In this Rendered View mode, items are shown grouped by their `@` tags, while the tags themselves are skipped. You can open the referenced web pages, view quick documentation for the referenced topics, and adjust the font size for better readability.

![Rendered View for JSDoc comments](https://resources.jetbrains.com.cn/help/img/idea/2026.2/ws_js_preview_jsdoc_comments_rendered_in_the_editor.animated.gif)

> **Tip:**
> The Rendered View mode is available both in JavaScript and in TypeScript.

Procedure:

* To enter the Rendered View mode, hover over a comment and click ![the Toggle Rendered View icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.gutter.javadocRead.svg) in the gutter or press `Ctrl+Alt+Q` (Windows), `⌃ ⌥ Q` (macOS), `⌃ ⌥ Q` (IntelliJ IDEA Classic (macOS)), `⌃ ⌥ Q` (macOS System Shortcuts), `Ctrl+Alt+Q` (XWin), `Ctrl+Alt+Q` (GNOME), `Ctrl+Alt+Q` (KDE), `Ctrl+Alt+Q` (Emacs), `Ctrl+Alt+Q` (Sublime Text), `⌃ ⌥ Q` (Sublime Text (macOS)), `Ctrl+Alt+Q` (NetBeans), `Ctrl+K, V` (Visual Studio), `⌘ K, V` (Visual Studio (macOS)), `Ctrl+Alt+Q` (Eclipse), `⌃ ⌥ Q` (Eclipse (macOS)). The icon turns into ![the Toggle Rendered View icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.gutter.javadocEdit.svg).

![Turn on the Rendered View mode](https://resources.jetbrains.com.cn/help/img/idea/2026.2/turn_on_rendered_view.png)

* To quit the Rendered View mode, click ![the Toggle Rendered View icon](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app.gutter.javadocEdit.svg) in the gutter, or select Toggle Rendered View from the context menu of a JSDoc comment, or press `Ctrl+Alt+Q` (Windows), `⌃ ⌥ Q` (macOS), `⌃ ⌥ Q` (IntelliJ IDEA Classic (macOS)), `⌃ ⌥ Q` (macOS System Shortcuts), `Ctrl+Alt+Q` (XWin), `Ctrl+Alt+Q` (GNOME), `Ctrl+Alt+Q` (KDE), `Ctrl+Alt+Q` (Emacs), `Ctrl+Alt+Q` (Sublime Text), `⌃ ⌥ Q` (Sublime Text (macOS)), `Ctrl+Alt+Q` (NetBeans), `Ctrl+K, V` (Visual Studio), `⌘ K, V` (Visual Studio (macOS)), `Ctrl+Alt+Q` (Eclipse), `⌃ ⌥ Q` (Eclipse (macOS)).

![Turn the Rendered View mode off](https://resources.jetbrains.com.cn/help/img/idea/2026.2/turn_off_rendered_view.png)

* To turn on the Rendered View mode for all JSDoc comments in the current file, select Render All Doc Comments from the context menu in the gutter.

![Render all comments in the current file](https://resources.jetbrains.com.cn/help/img/idea/2026.2/render_all_comments.png)

* If necessary, select Adjust Font Size from the context menu and change the font size using the slider.

![Adjust font size](https://resources.jetbrains.com.cn/help/img/idea/2026.2/adjust_font_size.png)

* To show all JSDoc comments rendered by default,   open the Settings dialog (`Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS))), go to `Editor | General | Appearance`, and select the Render documentation comments checkbox.

![Turn on Rendered JSDoc comments by default](https://resources.jetbrains.com.cn/help/img/idea/2026.2/ws_js_preview_jsdoc_comments_rendered_checkbox.png)

* To hide the Rendered View gutter icons, select Configure Gutter Icons… from the context menu in the gutter and then clear the Documentation comments in-place rendering checkbox on the `Settings | Editor | General | Gutter Icons` page that opens.

## See also

### Procedures

[Quick Documentation](viewing-reference-information.html#inline-quick-documentation) [Javadocs](javadocs.html)

### Reference

[Inspections](inspections-settings.html)

### External Links

[https://github.com/jsdoc3/jsdoc/](https://github.com/jsdoc3/jsdoc/) [JSDoc toolkit](https://code.google.com/p/jsdoc-toolkit/) [Google Closure Compiler](https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler)

