Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zachhardesty7/jsdoc-comment-toggler
quickly & intelligently add, remove, or convert comments to JSDoc via VSCode extension
https://github.com/zachhardesty7/jsdoc-comment-toggler
comments documentation javascript jsdoc jsdoc-comments typescript visual-studio-code vscode vscode-extension
Last synced: 3 months ago
JSON representation
quickly & intelligently add, remove, or convert comments to JSDoc via VSCode extension
- Host: GitHub
- URL: https://github.com/zachhardesty7/jsdoc-comment-toggler
- Owner: zachhardesty7
- License: mit
- Created: 2020-09-18T22:16:32.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-10-16T19:41:55.000Z (over 1 year ago)
- Last Synced: 2023-10-17T18:24:17.274Z (over 1 year ago)
- Topics: comments, documentation, javascript, jsdoc, jsdoc-comments, typescript, visual-studio-code, vscode, vscode-extension
- Language: TypeScript
- Homepage: https://marketplace.visualstudio.com/items?itemName=zachhardesty.jsdoc-comment-toggler
- Size: 804 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://marketplace.visualstudio.com/items?itemName=zachhardesty.jsdoc-comment-toggler)
[](https://marketplace.visualstudio.com/items?itemName=zachhardesty.jsdoc-comment-toggler)
[](https://marketplace.visualstudio.com/items?itemName=zachhardesty.jsdoc-comment-toggler)
[](https://github.com/zachhardesty7/jsdoc-comment-toggler/blob/master/LICENSE)# jsdoc comment toggler
extension to toggle a JSDoc comment on the target text, properly indenting and spacing
everythingno longer will you need to flip around between comment tags while converting a
JavaScript block or line comment into more formal JSDoc; put your cursor inside a
comment and bam## Features
- convert a line comment into JSDoc and vice versa

- convert a block comment into JSDoc and vice versa

- generate a new JSDoc comment to start documenting a variable

- generate inline JSDoc for "casting" a value with `@type`
## Usage
- command: `Toggle JSDoc Comment`
- keyboard shortcut: `ctrl+r ctrl+/` or `cmd+r cmd+/` for MacOS
- the shortcut uses chords - press the first key combination, release, and then
press the second (tip: you can hold `ctrl`/`cmd` the whole time)
- change shortcut in Preferences -> Keyboard Shortcuts -> Search "jsdoc-comment-toggler"## Extension Settings
- `jsdoc-comment-toggler.disableCursorHack` - disable a cursor hack that avoids a VSCode issue where it's impossible to add text after a cursor that's at the end of a line. In that scenario, this hack inserts a snippet with a zero-width-space after the cursor to invisibly keep the cursor in the correct position while running the edits. The extension removes the zero-width-space while adding the comment tags. This hack is safe to use because VSCode highlights the zero-width-space for you to manually remove if something fails. If you ever see a zero-width-space in a comment, please create an issue on GitHub with a reproducible case. As a workaround, you can enable this setting to prevent adding the zero-width-space and fixing the cursor position until we can address the bug.
- default: `false`
- still searching for a better way to do this and/or guarantee that a zero-width-space won't be left behind## TODO
- [ ] merge comments and JSDoc nested inside JSDoc
- [ ] wrap single line selection in parens for casting
- [ ] test placement of selection anchor and active for multiline comments
- [ ] convert to block comment when cursor is anywhere within JSDoc
- [ ] convert multiple adjacent (or empty) line comments into a single JSDoc block## Reporting issues
report any issues on the github
[issues](https://github.com/zachhardesty7/jsdoc-comment-toggler/issues) page, and please
provide as much detail as possible!## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details