# JSDoc comments

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/go/llms.txt).

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

GoLand 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 shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "EditorEnter"). JSDoc comments are used for documentation lookup with [Quick Documentation shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "QuickJavaDoc") in JavaScript and TypeScript, see JavaScript documentation look-up and [TypeScript documentation
look-up](https://www.jetbrains.com/help/go/typescript-support.html.md#ws_ts_documentation_look_up), as well as for [type
annotations](https://www.jetbrains.com/help/go/javascript-specific-guidelines.html.md#ws_js_type_hints) and method return type hints in chained methods.

GoLand also recognizes [TODO patterns](https://www.jetbrains.com/help/go/using-todo.html.md), [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).

<a id="ws_js_create_jsdoc_comments"></a>

## 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 shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "EditorEnter").

GoLand 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/help/img/idea/2026.3/ws_insert_jsdoc_comment.animated.gif)

> **Tip:**
> To turn off automatic generation of JSDoc comments,   open the Settings dialog ([Settings… shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "ShowSettings")), 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 [Find Action… shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "GotoAction") and start typing `Fix Doc Comment`. Then select Fix Doc Comment from the list, and press [Enter shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "EditorEnter").

<a id="ws_js_jsdoc_typescript_syntax"></a>

## TypeScript syntax in JSDoc comments

You can use TypeScript annotations, for example, `@type` or `@typedef`, within JSDoc comments in JavaScript files. GoLand 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.

GoLand provides code completion for TypeScript annotations.

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

Based on `@type` annotations, GoLand shows parameter hints.

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

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

<a id="ws_js_preview_jsdoc_comments_rendered_in_the_editor"></a>

## View JSDoc comments rendered in the editor

With GoLand, 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/help/img/idea/2026.3/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/help/img/idea/2026.3/app.gutter.javadocRead.svg) in the gutter or press [Toggle Rendered View shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "ToggleRenderedDocPresentation"). The icon turns into ![the Toggle Rendered View icon](https://resources.jetbrains.com/help/img/idea/2026.3/app.gutter.javadocEdit.svg).

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

* To quit the Rendered View mode, click ![the Toggle Rendered View icon](https://resources.jetbrains.com/help/img/idea/2026.3/app.gutter.javadocEdit.svg) in the gutter, or select Toggle Rendered View from the context menu of a JSDoc comment, or press [Toggle Rendered View shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "ToggleRenderedDocPresentation").

![Turn the Rendered View mode off](https://resources.jetbrains.com/help/img/idea/2026.3/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/help/img/idea/2026.3/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/help/img/idea/2026.3/adjust_font_size.png)

* To show all JSDoc comments rendered by default,   open the Settings dialog ([Settings… shortcut](https://www.jetbrains.com/help/go/llms-keymap-index.md "ShowSettings")), go to `Editor | General | Appearance`, and select the Render documentation comments checkbox.

![Turn on Rendered JSDoc comments by default](https://resources.jetbrains.com/help/img/idea/2026.3/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

### Reference

[Inspections](https://www.jetbrains.com/help/go/inspections-settings.html.md)

### 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)

