"Doc Tab" is a Visual Studio Code extension that allows you to edit the doc comments in a new tab.
The Problem
Editors like VSCode support markdown preview for JSDoc / TSDoc, but it's often challenging to edit, format, and indent it within the comment block. This extension is designed to assist in editing doc comments in a new tab, providing the benefits of specific language features such as Markdown's syntax highlighting, intelligence, linting, and formatting.
Setup
You can install the VSCode extension from the Visual Studio Marketplace or check out the source code from my GitHub repository.
Usage
- Choose or position the cursor within the documentation comment block.
- Access the command palette:
-
Ctrl+Shift+P
on Windows/Linux -
Cmd+Shift+P
on macOS
-
- Enter
Doc Tab: Edit Comment In New Tab
and hitEnter
. - Modify the documentation comment in the new tab.
- Close the tab without saving to discard any alterations.
- The changes will be applied to the documentation comment block. 🎉🎉
Recommended Workflow
- Format the code (using eslint, prettier, etc.).
- Edit the documentation comments in a new tab. It's advisable to preview while editing.
- Format the code in the new tab.
- Close the tab without saving.
- Format the code once again.
- Reformat the documentation comments (using Rewrap).
Recommended Extensions for Combined Use
Please feel free to file any issues or pull requests if you encounter any problems or have ideas. Thank you very much.
Top comments (0)