“Document This” is a popular Visual Studio Code extension that automatically generates detailed JSDoc comments for both TypeScript and JavaScript files. It eliminates the tedious task of manually typing code documentation by automatically mapping tags based on the functions, classes, interfaces, and methods you have already written.
The extension is widely used in the web development ecosystem, boasting over 680,000 installs on the Visual Studio Marketplace. Key Features
Automated Tag Detection: It scans your code syntax and populates JSDoc and Closure Compiler tags automatically. This includes @param, @returns, @class, @description, @enum, @export, @interface, @private, and @static.
IntelliSense Enhancement: By quickly generating correct JSDoc layouts, it allows VS Code and other editors to read your inline documentation, vastly improving auto-completion and code hints.
Entire File Documentation: Instead of doing it block by block, you can trigger the tool to automatically add doc blocks across your whole document at once. How to Use It
Put your cursor (caret) on or inside the specific function, class, or variable you want to document.
Press Ctrl + Alt + D twice (on Windows/Linux) or Cmd + Alt + D twice (on macOS).
The extension instantly populates the code block with a properly structured JSDoc comment ready for your custom descriptions. Configuration & Preferences
You can customize how the extension behaves by modifying your VS Code global or workspace settings. Available options include:
docthis.includeTypes: Toggles whether explicit data type information is added to the comment tags (Defaults to true).
docthis.includeDescriptionTag: Automatically adds the @description tag to your functions and methods.
docthis.includeAuthorTag and docthis.authorName: Automatically signs the code with your name using the @author tag.
docthis.includeDateTag: Automatically appends a timestamp of when the documentation block was created.
If you are trying to configure this tool for your workspace, let me know what language you are working in (JavaScript or TypeScript) or if you need help setting up specific keyboard shortcuts. Document This – Visual Studio Marketplace
Leave a Reply