JetBrains Rider 2020.2 Help

Create JSDoc comments

JetBrains Rider helps you create JSDoc comments and uses them for documentation lookup with Ctrl+Q in JavaScript and TypeScript, see JavaScript documentation look-up and TypeScript documentation look-up for details.

JetBrains Rider recognizes TODO patterns and Closure Compiler annotations 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 An Introduction to JSDoc.

Enable JSDoc comments

  1. In the Settings/Preferences dialog Ctrl+Alt+S, go to Editor | General | Smart Keys.

  2. In the Enter area, select the Insert documentation comment stub checkbox.

Create JSDoc comments

  • Position the caret before the declaration of the method/function or field to document, type the opening block comment /**, and press Enter. Describe the listed parameters, return values, and so on.

  • Alternatively, use the dedicated Fix Doc Comment action. Position the caret at the method/function or field to document, press Ctrl+Shift+A and start typing Fix Doc Comment. Then select Fix Doc Comment from the list, and press Enter.

View JSDoc comments rendered in the editor

With JetBrains Rider, 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
  • To enter the Rendered View mode, hover the mouse pointer over a comment and click the Toggle Rendered View icon in the gutter or press Ctrl+Alt+Q. The icon turns into the Toggle Rendered View icon.

    Turn on the Rendered View mode
  • To quit the Rendered View mode, click the Toggle Rendered View icon in the gutter, or select Toggle Rendered View from the context menu of the JSDoc comment, or just press Ctrl+Alt+Q.

    Turn the Rendered View mode off
  • 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
  • If necessary, select Adjust Font Size from the context menu and change the font size using the slider.

    Adjust font size
  • To show all JSDoc comments rendered by default, open the Settings/Preferences dialog Ctrl+Alt+S, go to Editor | General | Appearance, and select the Render documentation comments checkbox.

    Turn on Rendered JSDoc comments by default
  • To hide the 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/Preferences | Editor | General | Gutter Icons page, that opens.

Last modified: 19 August 2020