We’re using the commenting commands extension with Next to edit JavaScript, but I find its behavior to be unexpected when toggling. For example given selected lines like:
Line 1: // This is my for loop
Line 2: for (let i = 0; i < 10; i++) {
then toggling line comments produces:
Line 1: This is my for loop
Line 2: for (let i = 0; i < 10; i++) {
in other words, it uncomments the comment. What for us is the desired output would be:
Line 1: // // This is my for loop
Line 2: // for (let i = 0; i < 10; i++) {
this makes it so a re-toggle with the same selection produces the original value.
Is the current behavior intended? It is easy for us to just write our own implementation create a private copy of the @codemirror/comment code, but I wasn’t sure if this was a bug or a feature?