better-comments icon indicating copy to clipboard operation
better-comments copied to clipboard

Block comments have extremely irregular selection

Open aarondill opened this issue 2 years ago • 2 comments

Issue:

Block comment detection is extremely finicky, as is detection of comments within them. The top row isn't styled at all, also if there is no white space immediately following the blockCommentStart, the whole block is thrown out.

Steps to reproduce:

/*!this breaks it all
? Why am I not colored
*/
/* ? I don't break it, but I'm not styled
! I am red
/* ! I don't work at all */ 

Expected outcome:

All of the above text should be colored.

Actual outcome:

None of the above text is colored.

related to #447

aarondill avatar Dec 06 '22 09:12 aarondill

I discovered the same behavior with C and C++ code.

It does not seem possible to style a comment line that uses /* */ style comments on a single line.

I could style multiline comment only if the first comment line of a multiline comment started with /**. If I remove that superfluous *, then the styling does not work as expected.

Otherwise, this extension seems to work well.

paulej avatar Dec 11 '22 06:12 paulej

The behavior you are describing is because jsdoc comments (/**) are styled(and more importantly, detected) differently than normal block comments. My pull request should fix this issue, provided it gets accepted.

aarondill avatar Dec 11 '22 13:12 aarondill