# Teamscale Integration for IntelliJ

Teamscale integrates with IntelliJ IDEA and many other IntelliJ IDEs, such as WebStorm and PyCharm.

Before installing the Teamscale Integration for IntelliJ, make sure its system requirements are met.

# Download & Installation

The IntelliJ plugin has been tested and used on IntelliJ IDEA, WebStorm and PyCharm IDEs, but should also work on other IntelliJ IDEs. To download and install the Teamscale IntelliJ IDEA plug-in, perform the following steps:

  1. Inside an IDE browse the JetBrains Plugin Repositories via FileSettingsPluginBrowse Repositories.
  2. In the dialog box, search for »Teamscale IntelliJ Plugin«. On the right view, click the install button.
  3. Restart the IDE to conclude installation.
  4. If the plug-in installed properly, you should see a Teamscale menu entry in the main menu bar

# Configuring a Teamscale Server Connection

You need to perform the following actions to configure a Teamscale server:

  1. Open the IntelliJ IDEA Settings via the menu FileSettings.
  2. Expand Tools (1) and select Teamscale (2) on the left hand side.
  3. Use the + button to add a new Teamscale server (3).
  4. In the details (4) fill in a descriptive Name for the server, its URL, and your Username and Access Key

Configuring a Teamscale Server Connection

By clicking on the Get Key button, you can navigate to the Teamscale web interface and generate a personal access key.

Click the Validate Connection (5) button to ensure successful connection the Teamscale server. Click Apply and OK to save the settings.

# Enable Plugin for IDE

The plugin can be enabled for the IDE (i.e. for all opened projects). When turned on, plugin can communicate with Teamscale and fetch quality results. Activate this by clicking Teamscale menu → Fetch Findings from Teamscale Server. Ensure that this option is checked.

# Connecting an IDE Project to a Teamscale Project

In addition to enabling the Teamscale IntelliJ IDEA plug-in, it needs to know which Teamscale project the IDE project corresponds to. This mapping is done in the mapping settings page. To access the mapping settings page, you have to perform the following steps:

  1. Click File menu → Settings. Alternatively, you can click Teamscale menu → Configure Plugin ...
  2. Expand ToolsTeamscale. Click Project Mappings. This will open the following dialog:

Creating Project Mappings

  1. In the dialog, check the option Enable Teamscale quality analysis for project.
  2. Select the appropriate Teamscale server and project values.
  3. Create prefix mappings by clicking on the Auto-create Prefix Mappings button
  4. Click Apply and OK to save settings.

# File Mappings

Under normal circumstances, the plugin automatically determines how to map the module files to the files in the Teamscale project. If the automatic mapping failed, a message is shown. To manually configure mappings between the local and the server’s structure, you can add them in the module settings:

  1. Open the mapping settings page as mentioned above.
  2. Uncheck the option (Re)create prefix mappings.
  3. Create a mapping by clicking the + sign on the right side. Enter the mappings prefixes in the upcoming dialog. The Local Prefix is a part of your local directory structure. The Teamscale Prefix is a part of the project directory structure on the Teamscale server.

To check if everything is configured correctly, open the Teamscale Findings Tool Window via the menu (ViewTool WindowsTeamscale Findings):

Findings Tool Window

Now you can select any resource that has findings and wait for findings to appear in the Teamscale Findings Tool Window. The symbol on the top of the left hand side of the Tool Window will indicate the server’s reachability state. Hover the mouse over the icon to get additional information. A click on the icon opens up the Teamscale settings.

# Refresh Findings

In order to get an updated view of the findings of a selected folder or a file after changes in a file system, for instance by switching to a new repository or branch, click the button in the Teamscale Findings Tool Window.