Issue
I'm using Netbeans 11, and I have now switch from Ruby sass to Dart sass. The thing is that when I comment a block of code on my .scss files, they are commented like that:
@mixin test($var){
/*color:red;
font-size: #{var}*10;*/
color:blue;
}
The thing is that now in Dart sass, what's in between the /**/ is compiled and raises sometimes errors. Though I just want to comment it. So I would need to comment this way:
@mixin test($var){
//color:red;
//font-size: #{var}*10;
color:blue;
}
This is fine for 2 lines, but sometimes I need to comment big blocks, and Netbeans is not using the // but /**/. So is there a way to change the default commenting of Netbeans for .scss files? I mean this has to be somewhere since you can sometimes comment in blocks with #.
Any help would be greatly appreciated. Thanks a lot in advance!
Solution
Unfortunately, you can't do it. NetBeans matches file extensions with corresponding FileTypes (MIME). For each FileType, there is parsing implementation for it and it handles commenting and uncommenting. It does it differently for each mime type and usually, it is deep in the code of NetBeans.
If you are interested, the code for commenting css/scss
files is here and here.
I suppose alternatively you could use a cool feature called multiline editing. It allows editing multiple lines simultaneously. See here for example.
So just
- Move the cursor to the right
- Press ctrl+shift+R
- Press the mouse and move the cursor up, as if you are selecting the region.
- Press //
- Press ctrl+shift+R
For commenting it looks like this:
Answered By - Dmitry.M
Answer Checked By - Marie Seifert (JavaFixing Admin)