20Tauri / DoxyDoxygen

The last word in code documentation generation
140 stars 5 forks source link

Expand /**|*/ #166

Closed rchl closed 2 years ago

rchl commented 2 years ago

In a JS file, this expands to a JSDoc comment on pressing enter (| denotes the caret position):

/**|
export function test(arg) {
}

but this doesn't:

/**|*/
export function test(arg) {
}

To add a block comment I tend to press the default shortcut option+command+/ (on Mac) to create a block comment and then type one more * which ends up with the second case. But DoxyDoxygen doesn't expand second case to a JSDoc comment.

20Tauri commented 2 years ago

This is the expected behavior: Within a comment, enter continues the comment

Your workflow is interesting and can be optimized, try Super+Alt+Q shortcut, which will do exactly what you want in one command.

I know this shortcut is probably not the best (https://github.com/20Tauri/DoxyDoxygen/issues/5), but it can be remapped. Let me know if it's the reason why you don't use it, perhaps other users may be affected

rchl commented 2 years ago

Right. Then let me turn it around a bit.

What I would actually expect is for pressing enter to continue the comment in this case, not create a JSDoc.

What happens now is that this:

/**|*/

ends up as

/**
 |*/

While I would expect:

/**
 *|
 */
20Tauri commented 2 years ago

This is a good suggestion. Much more complex to implement than it seems because the syntaxes are not very consistent and can vary with time (the result in JavaScript, Pascal and Matlab are very different for example)

A modified version should however be available in the middle of next week in the Evolution channel

20Tauri commented 2 years ago

Now released on evolution channel

rchl commented 2 years ago

Doesn't seem quite right. It's a bit misaligned after pressing enter.

https://user-images.githubusercontent.com/153197/188713070-f4e0904e-c2d7-4e9a-8e32-4305feeda3bc.mov

20Tauri commented 2 years ago

Thank you for the report Fixed in 0.81.1

rchl commented 2 years ago

Seems perfect now, even with extra whitespace. Thank you.