Editing and viewing source while debugging
The following editors support debugging active script:
- Page Designer
- the HTML Source Page Editor
- the JavaScript Editor
In order to add active script breakpoints, use one of the above editors when you are debugging or preparing to debug active script.
When you launch an active script debug session, the source editor that opens by default depends on the file type that is opened:
File type Default editor HTML (.htm or .html) Page Designer Note:
- If a stack frame is selected, the HTML Source Page Editor opens.
- When debugging JSP-generated HTML or an HTML page that was navigated to by form submission, the filename of the source is not available to the Active Script Debugger. In this case, the debugger creates a temporary cached source file and the editor does open to display source. If you have previously-set breakpoints in the source of these pages (located in the workbench workspace), these breakpoints cannot be installed by the debugger. To be able to set a breakpoint in this source, suspend (or halt) the debug session before invoking the script that you wish to debug. While the debug session is suspended, you can set non-persistent breakpoints for the page. For information about non-persistent breakpoints (or breakpoints that are set in the temporary cached source outside of the workbench workspace), refer to the setting a line breakpoint topic below.
JSP (.jsp) Page Designer Note:
- If a stack frame is selected, the HTML Source Page Editor opens.
- When a JSP, the filename of the source is not available to the Active Script Debugger. In this case, the debugger creates a temporary cached source file and the editor does open to display source. If you have previously-set breakpoints in the source of these pages (located in the workbench workspace), these breakpoints cannot be installed by the debugger. To be able to set a breakpoint in this source, suspend (or halt) the debug session before invoking the script that you wish to debug. While the debug session is suspended, you can set non-persistent breakpoints for the page. For information about non-persistent breakpoints (or breakpoints that are set in the temporary cached source outside of the workbench workspace), refer to the setting a line breakpoint topic below.
JavaScript (.js) JavaScript Editor VisualBasic (.vbs) HTML Source Page Editor In the editors, you can perform various debug actions via pop-up menu in the editor. You may wish to set a different editor for debugging script for the following reasons:
- You wish to set the HTML Source Page Editor as the editor for VisualBasic script. Without this file association, you may not be able to add Active Script breakpoints for VisualBasic script.
- The default editors listed above do not open by default for your debug session (eg. their file association has been manually changed) and you would like to set them to open by default.
To set a specific editor to open for a file type, do the following:
- Select Window > Preferences from the workbench menu bar to open the Preferences dialog box.
- In this dialog box, choose Workbench > File Associations to open the File Associations page.
- In the File types section, select the type of file that you are debugging. If the file type does not appear in the list, click Add to add the file type.
- In the Associated editors section, click Add to open the Editor Selection dialog box.
- In this dialog box, ensure that the Internal Editors radio button is selected and choose the desired editor from the list of editors.
- Click OK to set the associated editor for the file type that you selected.
- Click OK to close the Preferences dialog box.
After completing the above, when you open the file type to view its source, the selected editor will be used.
Related concepts
Debugging Active Script
Related tasks
Debugging Web project script
Debug on Server
Debugging an HTML Script Application
Setting debug preferences
Halting a running program
Using breakpoints
Setting a line breakpoint
Enabling and disabling breakpoints
Removing breakpoints