Script Editor

The LN Studio script editor is used to edit the source code of UI scripts, libraries, DALs, functions, and report scripts.

The script editor is embedded in the Source tab of these multipage editors:

You can edit multiple software components simultaneously. Each component is displayed in a separate tab.

Associated with the script editor is an Outline view, which shows the structure of the active source code. The Outline view is updated automatically when you edit the source code.

See the following figure for an example.

Editing source code

To edit the source code of a component, go to the Source tab of the corresponding multipage editor:

  • To edit the source code of a function, open the function in the Function Editor and go to the Source tab.
  • To edit the source code of a library, open the library in the Library Editor and go to the Source tab.
  • To edit the source code of a report script, open the corresponding report in the Report Editor and go to the Source tab.
    Note: You can also start a separate script editor to set breakpoints in the report's debug script.

    See Using breakpoints.

  • To edit the source code of a UI script, open the corresponding session in the Session Editor and go to the Source tab.
  • To edit the source code of a DAL script, open the corresponding table in the Table Editor and go to the Source tab.
Note: The Source tab is only displayed if the source code is available.

The editor displays error markers to indicate errors in the source code. When you save a component which contains errors, the component is only stored in your local workspace but is not saved to the server. In the Activity Explorer, the component has a dirty state ( ) decorator in the bottom right corner of the software component image. When you solve the error and save the component, the component is saved to the server again and the decorator disappears.

Alternative ways to open source code

You can also start the script editor in the following ways:

  • Through the Open Declaration command.

    See Open Declaration.

  • From various views, such as the Problems view, the Tasks view and the Bookmarks view. For example:
    • When you double-click a problem, task, or bookmark associated with a specific component, the editor opens the corresponding source.
    • When you double-click a problem, task, or bookmark associated with a specific line in a specific component, the editor opens the corresponding source on that line.
    Note: The editor is not started when you double-click a generic problem, task, or bookmark not associated with any specific component.

    Instead of double-clicking, you can use the Go To command on the view's shortcut menu.

Script editor features

This topic focuses primarily on the LN Studio specific features. It does not describe the standard Eclipse editor functionality, such as the Cut, Copy, Paste, Delete, and Save commands.

For details on the standard Eclipse editor features, see the Workbench User Guide.

For details on the LN Studio specific editor features, see these sections:

Note: All features listed are available if you start the editor in the Application perspective. When you debug software components, the editor starts automatically in the Debug perspective. During the debugging, only a part of the editor's functionality is available.

For information on preference settings for the editor, see Script Editor Preferences.

For information on the limitations of the editor, see LN Studio Limitations.