RustRover 2024.2 Help

Configuring JavaScript debugger

RustRover provides a built-in debugger for your client-side JavaScript code. The built-in debugger starts automatically when you launch a debugging session.

To ensure successful debugging, it is enough to specify the built-in web server port and accept the default settings that RustRover suggests for other debugger options.

Before you start

  1. Make sure the JavaScript Base bundled plugin is enabled in the settings. Press Ctrl+Alt+S to open settings and then select Plugins. Click the Installed tab. In the search field, type JavaScript Base. For more information about plugins, refer to Managing plugins.

  2. Make sure the JavaScript Debugger bundled plugin is enabled in the settings. Press Ctrl+Alt+S to open settings and then select Plugins. Click the Installed tab. In the search field, type JavaScript Debugger. For more information about plugins, refer to Managing plugins.

Set the built-in web server port

  1. Press Ctrl+Alt+S to open settings and then select Build, Execution, Deployment | Debugger.

  2. In the Built-in server area, specify the port where the built-in web server runs. By default, this port is set to the default RustRover port 63342 through which RustRover accepts connections from services. You can set the port number to any other value starting from 1024.

    Built-in server port

Customize the default debugger configuration

Suppress calls

  1. Open settings by pressing Ctrl+Alt+S and navigate to Build, Execution, Deployment | Debugger.

  2. Suppress calls to the files on the built-in server from other computers or from outside RustRover by clearing the Can accept external connections or the Allow unsigned requests checkbox respectively.

    Suppress external calls

Choose the way to remove breakpoints

By default, ypu can toggle breakpoints by clicking the left mouse button. To change this behavior:

  1. Open settings by pressing Ctrl+Alt+S and navigate to Build, Execution, Deployment | Debugger.

  2. In the Remove breakpoint area, select the appropriate option.

    Remove breakpoints

Advanced options

  • Open settings by pressing Ctrl+Alt+S and navigate to Build, Execution, Deployment | Debugger | Data Views.

    Enable or disable Inline Debugging, specify when you want to see tooltips with object values and expressions evaluation results, and so on.

    JavaScript debugger: Data views
  • Open settings by pressing Ctrl+Alt+S and navigate to Build, Execution, Deployment | Debugger | Data Views.

    Specify whether you want object properties to be shown in object nodes. If so, specify the properties. Use and to manage the list of properties.

    Properties to show on object nodes

Start a debugging session with your default Chrome user data

You may notice that your debugging session starts in a new window with a custom Chrome user data instead of your default one. As a result, the window looks unusual, for example, your bookmarks, the browser history, and the extensions are missing, which altogether breaks your development experience. That happens because RustRover uses the Chrome Debugging Protocol and runs Chrome with the --remote-debugging-port option. However, if Chrome is already started, a debugging port can't be opened for any new or existing Chrome instance that has the same user data. Therefore, RustRover always starts a debugging session with in a new window with custom user data.

To open a new Chrome instance with your familiar look-and-feel, configure Chrome in RustRover to start with your user data. In this case, before starting a debugging session, always make sure that Chrome is not already running with your user data. Otherwise, RustRover still launches another instance of Chrome with your user data but is unable to open a debugging port for it. As a result, RustRover debugger fails to connect to the application in the new Chrome instance and the debugging session does not start.

Custom Chrome user data

Configure Chrome in RustRover to start with your Chrome user data

  1. Save your Chrome user data anywhere on your machine.

  2. Press Ctrl+Alt+S to open settings and then select Tools | Web Browsers and Preview.

  3. To create a new Chrome configuration, click Add. A new item appears in the list. In the Path field, specify the path to the Chrome installation folder.

  4. Select the new configuration and click the Edit button (Edit).

  5. In the Chrome Settings dialog, select the Use custom user data directory checkbox and specify the path to your user data directory in the RustRover settings.

  6. Mark your Chrome browser configuration default as described in Web Browsers. Do not forget to select the necessary browser from the Browser list when creating a run/debug configuration.

Last modified: 08 October 2024