How to format vb file inside Ranorex Studio

Ranorex Studio, Spy, Recorder, and Driver.
palbaret
Posts: 26
Joined: Wed Jun 27, 2012 4:21 pm

How to format vb file inside Ranorex Studio

Post by palbaret » Fri Jun 29, 2012 6:11 pm

at the present time in Ranorex studio (3.2.0), i found 2 options to reformat my vb file:
  • Edit > Format > Indent: Ctrl-I: to re-indent code
  • Refactor > Remove unused imports
Is there a way to format code?
for example something which
  • put a space before and after each =
  • put a space before and after each &
  • put a space after each comma separator in list
  • ...
Or a way to execute automatically a set of regex transformation?

My goal is when I have a code like :

Code: Select all

private Sub Init(var as String,var2 as Double,   var3 as String   )
			' Your recording specific initialization code goes here.
			edQuestionsdetail=New QuestionsDetail()
			edQuestionsdetail.sReference    =   varReference
			edQuestionsdetail.sLevel  =  varLevel &"string"    & "yy"
			
		End Sub
By a single function, I want to transform it to

Code: Select all

		private Sub Init(var as String, var2 as Double, var3 as String)
			' Your recording specific initialization code goes here.
			edQuestionsdetail = New QuestionsDetail()
			edQuestionsdetail.sReference = varReference
			edQuestionsdetail.sLevel = varLevel & "string" & "yy"
			
		End Sub

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: How to format vb file inside Ranorex Studio

Post by Support Team » Mon Jul 02, 2012 12:02 pm

Hi,

Did you take a look at the coding options in the Options window?
You will find it if you click on: Tools -> Options -> Coding.

Regards,
Markus
Ranorex Support Team

palbaret
Posts: 26
Joined: Wed Jun 27, 2012 4:21 pm

Re: How to format vb file inside Ranorex Studio

Post by palbaret » Mon Jul 02, 2012 5:08 pm

I didn't know this option but it's not enough for me.

For example if I type in the editor

Code: Select all

i=1
MyList=MyFunction(     1,2,3,4)
it should be automatically transformed as :

Code: Select all

i = 1
MyList = MyFunction(1, 2, 3, 4)
This feature exists in VisualStudio, Within Eclipse there is some option to do that automatically.

I've developed a small exe vb parser, in order to parse all my code with some rules. It's based on some regex replacement rules.
It will be nice to have the opportunity to apply a set of predefined regex rule based on your "Replace" feature.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: How to format vb file inside Ranorex Studio

Post by Support Team » Tue Jul 03, 2012 4:43 pm

Hello,

Ranorex is based on SharpDevelop 3.0.There is unfortunately only the Ctrl + i shortcut included to format the code. If there is a AddIn for SharpDeveloper 3.0 for VB you can try to install it.

Regards
Bernhard
Ranorex Support Team