Page 1 of 1

Comment/Uncomment code in the Rx IDE using keyboard shortcut

Posted: Wed Mar 25, 2015 4:41 am
by tijnasarsimovich
Is there any way to comment and uncomment code using keyboard shortcuts in the IDE? Like Ctrl+Shift+C / Ctrl+Shift+U in Visual Studio?

Re: Comment/Uncomment code in the Rx IDE using keyboard shortcut

Posted: Thu Mar 26, 2015 11:00 am
by Support Team
Hello tijnasarsimovich,

Yes, this is possible, but you have to edit the ICSharpCode.SharpDevelop.addin file manually.
The file can be found in the directory "C:\Program Files (x86)\Ranorex 5.3\RanorexStudio\AddIns".
Just add the line shortcut="Control|Shift|X" to the section "<MenuItem id = "Comment"" as shown below.
<MenuItem id = "Comment"
		          icon  = "Icons.16x16.CommentRegion"
		          label = "${res:XML.TextAreaContextMenu.CommentUncommentSelection}"
		          shortcut="Control|Shift|X"
		          class = "ICSharpCode.SharpDevelop.Editor.Commands.CommentRegion"/>
Please don't use Ctrl+Shift+C because this is already in use.

Regards,
Bernhard

Re: Comment/Uncomment code in the Rx IDE using keyboard shortcut

Posted: Fri Jun 12, 2015 3:41 pm
by lucian.teodorescu
Hi,
The correct code is:

Code: Select all

<MenuItem id = "Comment"  
                  icon  = "Icons.16x16.CommentRegion"  
                  label = "${res:XML.TextAreaContextMenu.CommentUncommentSelection}"  
                  shortcut="Control|Shift|X"
                  class = "ICSharpCode.SharpDevelop.Editor.Commands.CommentRegion"/>  
For some reasons "shortcut" appears twice in previous code.

Re: Comment/Uncomment code in the Rx IDE using keyboard shortcut

Posted: Mon Jun 15, 2015 10:14 am
by Support Team
Hello lucian.teodorescu,

Thank you very much for the hint this was some kind of a typo.
I changed the line in my previous post in order to prevent confusion for other users.
Than you.

Regards,
Bernhard

Re: Comment/Uncomment code in the Rx IDE using keyboard shortcut

Posted: Mon Jun 15, 2015 11:30 am
by odklizec
Unless I'm missing something, there is no need to modify anything? It's already possible to comment/uncomment code (selected row or block) using Ctrl+/ shortcut. I'm using it on a daily basis ;) I believe I've found it in SharpDevelop documentation?

Re: Comment/Uncomment code in the Rx IDE using keyboard shortcut

Posted: Wed Jun 17, 2015 1:43 pm
by Support Team
Hi odklizec,

normally it should not work out of the box with the shortcut you described in your post. Are you sure that you didn't modify the addin file :-).

Regards,
Bernhard

Re: Comment/Uncomment code in the Rx IDE using keyboard shortcut

Posted: Wed Jun 17, 2015 1:54 pm
by odklizec
Hi Bernhard,

Most probably no. I don't remember modifying this file and I guess I would have to modify it every time I update Ranorex with newest version? I can't even find such shortcut there? ;) Maybe it's something hardcoded?

PS: I believe I found it here (search for "Toggle comments"):
https://github.com/icsharpcode/SharpDev ... -Shortcuts

Re: Comment/Uncomment code in the Rx IDE using keyboard shortcut

Posted: Fri Jun 19, 2015 12:27 pm
by Support Team
Hello odklizec,

That's strange. I discussed that with one of our developers and it is not defined in the source code as well.
Is there another SharpDevelop version installed on your machine?
But Ranorex should also not use this addon file.

Regards,
Bernhard

Re: Comment/Uncomment code in the Rx IDE using keyboard shortcut

Posted: Fri Jun 19, 2015 12:40 pm
by odklizec
Hi Bernhard,

No, I don't have SharpDevelop on this machine. Just Ranorex 5.3.2. And I just tried it on my VM and it works here as well. And I'm quite sure I did not modify anything on that VM. Can't you reproduce it at your side with clean Ranorex setup?

Re: Comment/Uncomment code in the Rx IDE using keyboard shortcut

Posted: Fri Jun 19, 2015 12:54 pm
by lucian.teodorescu
Ctrl+/ works for me too.

Re: Comment/Uncomment code in the Rx IDE using keyboard shortcut

Posted: Mon Jun 22, 2015 9:25 pm
by Support Team
Hi everybody,

The reason seems to be the keyboard layout. I guess you have an English keyboard. I have a German one and that's why it didn't work for me.
On a German keyboard it works with the shortcut Ctrl+#. It must be defined hard-coded in the SharpDevelop source code.
Thank you.

Regards,
Bernhard