

View JSDoc comments rendered in the editor However, when JSDoc and TypeScript syntax are in contradiction, PhpStorm uses JSDoc syntax.
#Jetbrains phpstorm documentation code#
PhpStorm provides code completion for TypeScript annotations.īased on annotations, PhpStorm shows parameter hints. PhpStorm recognizes TypeScript syntax constructs, for example, union types or optional properties in declarations.

You can use TypeScript annotations, for example, or within JSDoc comments in JavaScript files. Then select Fix Doc Comment from the list, and press Enter. Position the caret at the method/function or field to document, press Control+Shift+A and start typing Fix Doc Comment. To turn off automatic generation of JSDoc comments, open the Settings dialog ( Control+Alt+S), go to Editor | General | Smart Keys, and clear the Insert documentation comment stub checkbox in the Enter area.Īlternatively, use the dedicated Fix Doc Comment action. Describe the listed parameters, return values, and so on. PhpStorm generates a JSDoc comment with a list of parameters ( and return values ( where applicable.

Position the caret before the declaration of the method/function or field to document, type the opening block comment /**, and press Enter. PhpStorm also recognizes TODO patterns, Closure Compiler annotations, and TypeScript syntax inside documentation comments and uses them in code completion, intention actions, and other types of coding assistance.įind a detailed description of the JSDoc syntax with examples in Getting Started with JSDoc and JSDoc supported types. JSDoc comments are used for documentation lookup with Control+Q in JavaScript and TypeScript, see JavaScript documentation look-up and TypeScript documentation look-up, as well as for type annotations and method return type hints in chained methods. PhpStorm recognizes JSDoc comments and helps you create them by automatically inserting and other tags when you type the opening block comment /** and press Enter.
