Script beautify options for Webservice


#1

Hi Team,

We extensively work with web services and we had an issues in formatting the webservices script.
We have shared the expected format which is easier to trouble shoot and understand what has been sent and actual format below to that.
Is there any reg_expression that we update and bring it?

Expected Format:
WS.sendRequest(findTestObject(‘SOAP/Sum’,
[ (‘variable_0’) : ‘1’,
(‘variable_1’) : ‘2’,
(‘variable_2’) : ‘3’,
(‘variable_3’) : ‘4’,
(‘variable_4’) : ‘5’,
(‘variable_5’) : ‘6’,
(‘variable_6’) : ‘7’,
(‘variable_7’) : ‘8’,
(‘variable_8’) : ‘9’,
(‘variable_9’) : ‘10’,
(‘variable_10’) : ‘11’,
(‘URL’) : GlobalVariable.URL,
]))

Actual Format:

WS.sendRequest(findTestObject(‘SOAP/Sum’, [(‘variable_0’) : ‘1’, (‘variable_1’) : ‘2’, (‘variable_2’) : ‘3’, (‘variable_3’) : ‘4’
, (‘variable_4’) : ‘5’, (‘variable_5’) : ‘6’, (‘variable_6’) : ‘7’, (‘variable_7’) : ‘8’, (‘variable_8’) : ‘9’
, (‘variable_9’) : ‘10’, (‘variable_10’) : ‘11’, (‘URL’) : GlobalVariable.URL]))

@Russ_Thomas
Any suggestions would help us!


#2

Sorry. I guess I’m stupid. I have no idea what the problem is. :confused:


#3

I am trying my best again, below is expected code format (Beautified) [line by line ‘Key’:‘Value’ pair]
image

By pressing Ctrl + Shift + F --> takes the format to below screen shot.

Note: Here I am talking the alignment change of code specific new line and tab.


#4

I went to the doctor the other day. He said, “What’s wrong?”
I said, “It’s my arm, Doctor. Everytime I move it like this, I get this pain in my shoulder.”
He said, “Well, stop doing it then.”

You’re choosing the Java formatting option. If you don’t like it, don’t use it.

Sorry, don’t know what else I can tell you.


#5

Hi @Udaya

I think what you need is a Java code formatter that suites your synthetic sense. In Preferences you can import your own code formatter.

You can press New … to create your own code formatter. I don’t know how to achieve the look you want, so you’d probably have to figure that out yourself.


#6

Thanks a lot @ThanhTo, This helps!

My team has knowledge on it! I will update on same thread when we were able to solved!