Open sesquialtera87 opened 1 month ago
@sesquialtera87 can you rebase and fix the merge conflicts here? I'd be interested in adding this fix to the next release.
@sesquialtera87 I hate to ask this, but can you remove all the formatting changes? They're making this PR much larger than it should be and obfuscating the actual change.
No problem. In the next few days I'll try to restore the formatting and include only the new code, without touching anything else in the code
I'm struggling with Git... I removed every formatting stuff except my own relevant changing to the code, but after committing into this branch or merging with other clean branches I still see into the diff the unusefull IDE reformat insertions.
So, I created a new branch with only the relevant changes to ToggleCommentAction
and in this new branch everything work. I dont' know if it's possible to associate to this pull request the new branch I've created. If you think so, I can create a new pull request from the new branch and close this.
Lastly, I include the corrections to the errors reported by the last CodeQL/Gradle analysis. I think those now are fixed.
I tried to solve the comment-mark identification by
ToggleCommentAction.
Basically, the use ofstartsWith
andendsWith
methods allowed only to search for comment-marks at position 0 andline.length()-1
, not recognizing in this way comments likewhere some whitespaces are present before or after the marks.
Instead of the
startsWith
andendsWith
, I introduced two methods looking for mark by skipping leading or trailing whitespaces. Now de-comment a code like this work as expected (previously another comment would have been inserted)I hope it can be useful