Comment/Uncomment code in the Rx IDE using keyboard shortcut

Ranorex Spy, Recorder, and Studio.
tijnasarsimovich
Posts: 1
Joined: Wed Feb 18, 2015 9:28 am

Comment/Uncomment code in the Rx IDE using keyboard shortcut

Post by tijnasarsimovich » Wed Mar 25, 2015 4:41 am

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?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

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

Post by Support Team » Thu Mar 26, 2015 11:00 am

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
.
Image

lucian.teodorescu
Posts: 82
Joined: Fri Oct 24, 2014 10:58 am
Location: Bucharest

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

Post by lucian.teodorescu » Fri Jun 12, 2015 3:41 pm

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.
Lucian Teodorescu
NetSun Software

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

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

Post by Support Team » Mon Jun 15, 2015 10:14 am

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
.
Image

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

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

Post by odklizec » Mon Jun 15, 2015 11:30 am

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?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

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

Post by Support Team » Wed Jun 17, 2015 1:43 pm

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
.
Image

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

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

Post by odklizec » Wed Jun 17, 2015 1:54 pm

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
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

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

Post by Support Team » Fri Jun 19, 2015 12:27 pm

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
.
Image

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

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

Post by odklizec » Fri Jun 19, 2015 12:40 pm

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?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

lucian.teodorescu
Posts: 82
Joined: Fri Oct 24, 2014 10:58 am
Location: Bucharest

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

Post by lucian.teodorescu » Fri Jun 19, 2015 12:54 pm

Ctrl+/ works for me too.
Lucian Teodorescu
NetSun Software

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

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

Post by Support Team » Mon Jun 22, 2015 9:25 pm

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
.
Image