[Request] Comment / Uncomment selected code

Started by Billbis, Tue 05/03/2013 21:59:47

Previous topic - Next topic

Billbis

As a novice programmer, I have taken the habit to test alternative methods of code by commenting / uncommenting portion of my scripts code.
I have not found such options in AGS editor 3.2.1 (but I may have not search at the right place...)
Would it be possible to add a button in the right click menu that will comment selected lines of code (i.e. adding a // at the beginning of each line)? and of course the reverse option will be useful too!
Am I the only one that will use this option?
Thanks.

Crimson Wizard

Not sure, why do you need a separate button, is the /* */ comment style not useful enough? Or you mean, this is wanted for faster work, or something like that?

On other hand, I can't argue that this might be handy...

Calin Leafshade

VS has the shortcut Ctrl E - C for this and it is indeed very useful.

I will add it to my list of things to add.

RickJ

If you end comment sections with /**/ then you can comment/uncomment by placing/removing /* where the comment is to begin.
Code: AGS

/*
    Commented-out code Here
/**/


Code: AGS


    Running code Here
/**/

MiteWiseacreLives!


Snarky

Ctrl-/ in... Eclipse, I guess. That always made sense to me.

Billbis

#6
Quote from: Crimson Wizardis the /* */ comment style not useful enough?
Hey, I did not known that! Thanks for this magical tip, Mr Crimson Wizard!
Now I feel stupid to ask for something already implemented (the ability to quick comment large number of lines)...  :-[
Sorry about that.

Quote from: Calin LeafshadeI will add it to my list of things to add.
That will be nice. But when you now the /* */, a button / keyboard shortcut is less necessary.

Is this /* */ notation mention somewhere in the manual? I can't find it in scripting tutorial.

Crimson Wizard

Quote from: Billbis on Wed 06/03/2013 07:34:16
Quote from: Crimson Wizardis the /* */ comment style not useful enough?
Hey, I did not known that! Thanks for this magical tip, Mr Crimson Wizard!
Now I feel stupid to ask for something already implemented (the ability to quick comment large number of lines)...  :-[
Sorry about that.
Well, no need to feel stupid or sorry!

BTW, I can't see this in manual :-/. Guess this info was missed.

Khris

I use this:

Code: ags
//*
code
code
code
//*/


Code: ags
/*
code
code
code
//*/


That way you can keep the start of the comment block when the code is active.

cat

At work I use the VS feature Calin has mentioned (though I use the button because I fail to remember shortcuts). It is very useful and I prefer it over the /**/

SMF spam blocked by CleanTalk