---
url: /howto/integrating-with-your-ide/other-ides.md
---

# Teamscale Integration for Other IDEs and Editors

By using a small [command-line client for developers (`teamscale-dev`)](../../../reference/cli/teamscale-dev/) Teamscale can be integrated into other IDEs or editors for which no dedicated plug-in exists.
This makes it possible to use Teamscale, for example, from within [Visual Studio Code](../visual-studio-code/) or [Sublime Text](#sublime-text).

\[\[toc]]

:::tip License Information
The `teamscale-dev` tool is licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0).
See the [License section](../../../reference/cli/teamscale-dev/index.md#license) for details on licenses of third-party libraries distributed with it.
:::

## Installing `teamscale-dev`

If you haven't done so already, [install the `teamscale-dev` command-line client](../../../reference/cli/teamscale-dev/index.md#installation) for [Linux](../../../reference/cli/teamscale-dev/index.md#linux), [Windows](../../../reference/cli/teamscale-dev/index.md#windows), or [macOS](../../../reference/cli/teamscale-dev/index.md#macos).

## Configuring Your Projects Using `.teamscale.toml` Files

Before you can use `teamscale-dev`, your local projects need to be configured to map to projects on the Teamscale server.
This is done using one or more `.teamscale.toml` configuration files in a simple, uniform [file format (`.teamscale.toml`)](../../../reference/teamscale-toml/).

In the simplest case, place a file like the following in the root directory of your project:

```toml
root = true

[project]
id = "example"

[server]
url = "https://example.com/teamscale/"
```

For more advanced cases, please refer to the documentation of the [file format](../../../reference/teamscale-toml/).

## Invoking `teamscale-dev` from Different IDEs or Editors

### Sublime Text

To use `teamscale-dev` conveniently from within [Sublime Text](https://www.sublimetext.com/), perform the following steps:

1. Add a new build system (*Tools* > *Build System* > *New Build System...*).
2. Copy (or download) and paste the following snippet in Sublime Text's [build-system format](https://www.sublimetext.com/docs/build_systems.html):

   ```json
   {
     "cmd": [
       "teamscale-dev/bin/teamscale-dev",
       "pre-commit",
       "--user",
       "TODO Your username",
       "--accesskey",
       "TODO Your access key",
       "$file"
     ],
     "keyfiles": [
       ".teamscale.toml"
     ],
     "file_regex": "^(.*):(\\d+):(\\d+):\\s+(?:error|warning):\\s+(.*)$"
   }

   ```
3. Adapt the `cmd` property to point to your `teamscale-dev` executable (`bin/teamscale-dev.bat` on Windows, `bin/teamscale-dev` on Linux and macOS).
4. Adapt the `cmd` property so that the `--user` and `--accesskey` options use your credentials, i.e., your *username* and [*access key*](../../../glossary/index.md#access-key).
   (See the documentation of the [command-line client](../../../reference/cli/teamscale-dev/index.md#supplying-server-credentials) for further ways to supply your credentials.)

Executing a build with the *pre-commit* build system will now show any findings for the current file.

### Vim/NeoVim

To use `teamscale-dev` conveniently from within Vim or NeoVim, we provide [integration via a compiler plug-in](https://github.com/cqse/teamscale-vim).

1. Copy [compiler/teamscale.vim](https://github.com/cqse/teamscale-vim/blob/master/compiler/teamscale.vim) to your `$VIMRUNTIME/compiler` folder, e.g. `~/.config/nvim/compiler` for NeoVim.

2. In your `.vimrc`, you must at least define the variables mentioned in [vimrc.vim](https://github.com/cqse/teamscale-vim/blob/master/vimrc.vim) to let the plug-in know your Teamscale credentials and where `teamscale-dev` is installed.
   Optionally, you can use the remaining commands in that file to define a convenient command `:Precommit` to run pre-commit for the current file and a keyboard mapping.
   Internally, this command selects Teamscale as the compiler, calls `:make %`, and then reverts to your previously set compiler to not interrupt your existing compiler/make workflow.
   Any findings are then shown in the quickfix window (`:cw`).

If you want pre-commit on-save, you can define a [`BufWritePost`](https://vimdoc.sourceforge.net/htmldoc/autocmd.html#BufWritePost) autocommand to call `:Precommit` whenever the current buffer is written.

### XCode

To use `teamscale-dev` conveniently from within [XCode](https://developer.apple.com/xcode/), perform the following steps:

1. Configure credentials (This step only needs to be performed once for all your XCode projects.):
   1. Create a file called `.teamscale-dev.args` in your home directory (i.e., `/Users/<username>/.teamscale-dev.args`).
   2. Configure an [args file for supplying credentials](../../../reference/cli/teamscale-dev/index.md#supplying-command-line-options-via-an-args-file).
2. Configure XCode project:
   1. Open your project in XCode.
   2. Select project in the *Project navigator*.
   3. Add new target called `Teamscale Pre-Commit`:
      1. In the *TARGETS* panel, click the *+* icon.
      2. Select *Other > Aggregate* and go to *Next*.
      3. Set the name *Product Name* to `Teamscale Pre-Commit`.
   4. Add a new *Run Script* phase to the build of the new target:
      1. Go to the *Build Phases* tab of the *Teamscale Pre-Commit* target.
      2. Add a *New Run Script Phase* via the *+* icon in the top left corner.
      3. Set the *Shell* command to:
         ```shell
         teamscale-dev pre-commit @"${HOME}/.teamscale-dev.args" --only-uncommitted-changes "${SRCROOT}"
         ```

Once this is configured you can select the *Teamscale Pre-Commit* target at the top and then run pre-commit by executing the active scheme via the play button at the top.
This will execute pre-commit analysis on new or changed files that have not been committed yet.
