How to map between manual steps to script mode line number in Katalon Studio

Let me show you an example how the system is complexed. I would quote an example from Katalon loses vital code switching to/from Manual View (was Katalon issue Javascript) - #3 by kazurayam

Here I have a Test Case script manually coded in the Script mode:

def js = """
    console.log("Hello, world!");
"""

println js

I switched the Manual mode, and I altered the Test Case a bit in the Manual mode: I inserted a call to WebUI.acceptAlert(). I switched back to the Script mode.

Then I found the following code in the Script mode.

def js = '\n    console.log("Hello, world!");\n'

println(js)

WebUI.acceptAlert()

As you see, Katalon Studio mangled the original string literal quoted with a pair of triple " symbols into a completely different form of string literal.

In the original code, the string literal had 3 lines. But that stuff was transformed into 1 line of code.

This transformation by Katalon Studio involves the Groovy compiler and the Abstract Syntax Tree transformation technique.

I think, this transformation is complexed enough.