Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggle JSDoc Comment command should remove comment when selection had already been a jsdoc #18

Open
tjx666 opened this issue Dec 16, 2023 · 2 comments

Comments

@tjx666
Copy link
Contributor

tjx666 commented Dec 16, 2023

Current

Current behavior is wrap the jsdoc with outer level jsdoc.

before:

/**
 * const promise = promiseAll([() => new Promise(res => res(42))])
 * promise.then(console.log); // [42]
 */

after run Toggle JSDoc Comment:

/**
 * /**
  * * const promise = promiseAll([() => new Promise(res => res(42))])
  * promise.then(console.log); // [42]
  * */
 */

Expect

before:

/**
 * const promise = promiseAll([() => new Promise(res => res(42))])
 * promise.then(console.log); // [42]
 */

after run Toggle JSDoc Comment:

const promise = promiseAll([() => new Promise(res => res(42))])
promise.then(console.log); // [42]
@kalnode
Copy link

kalnode commented Sep 18, 2024

Looking for this as well; x10.

@zachhardesty7
Copy link
Owner

zachhardesty7 commented Oct 15, 2024

If you select the entire JSDoc comment, then run the toggle, it should (I believe this feature is published) convert the JSDoc comment into line comments. I could definitely add a setting to control whether the comment is removed or swapped to line comments!

If you're looking to just place the cursor anywhere in the JSDoc comment block, I'm currently working on that feature. It's fairly tricky to get it all working and not overshoot or undershoot the correct lines. The trickiest part though is getting all the whitespace correct in different scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants