Adventure Game Studio

AGS Development => Editor Development => Topic started by: Billbis on Tue 05/03/2013 21:59:47

Title: [Request] Comment / Uncomment selected code
Post by: Billbis on Tue 05/03/2013 21:59:47
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.
Title: Re: [Request] Comment / Uncomment selected code
Post by: Crimson Wizard on Tue 05/03/2013 22:08:29
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...
Title: Re: [Request] Comment / Uncomment selected code
Post by: Calin Leafshade on Tue 05/03/2013 22:25:12
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.
Title: Re: [Request] Comment / Uncomment selected code
Post by: RickJ on Wed 06/03/2013 00:30:03
If you end comment sections with /**/ then you can comment/uncomment by placing/removing /* where the comment is to begin.
Code (AGS) Select

/*
    Commented-out code Here
/**/


Code (AGS) Select


    Running code Here
/**/
Title: Re: [Request] Comment / Uncomment selected code
Post by: MiteWiseacreLives! on Wed 06/03/2013 04:18:20
That's slick RickJ
Title: Re: [Request] Comment / Uncomment selected code
Post by: Snarky on Wed 06/03/2013 07:28:50
Ctrl-/ in... Eclipse, I guess. That always made sense to me.
Title: Re: [Request] Comment / Uncomment selected code
Post by: 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.

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.
Title: Re: [Request] Comment / Uncomment selected code
Post by: Crimson Wizard on Wed 06/03/2013 07:49:44
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.
Title: Re: [Request] Comment / Uncomment selected code
Post by: Khris on Thu 07/03/2013 12:56:48
I use this:

Code (ags) Select
//*
code
code
code
//*/


Code (ags) Select
/*
code
code
code
//*/


That way you can keep the start of the comment block when the code is active.
Title: Re: [Request] Comment / Uncomment selected code
Post by: cat on Thu 07/03/2013 13:10:07
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 /**/