An open API service indexing awesome lists of open source software.

https://github.com/kronicdeth/intellij-elixir

Elixir plugin for JetBrain's IntelliJ Platform (including Rubymine)
https://github.com/kronicdeth/intellij-elixir

androidstudio appcode clion datagrip-ide editor editor-plugin elixir elixir-mix elixir-plugin gogland hacktoberfest ide intellij-plugin java jetbrains mix pycharm rubymine webstorm

Last synced: 13 days ago
JSON representation

Elixir plugin for JetBrain's IntelliJ Platform (including Rubymine)

Awesome Lists containing this project

README

          

Table of Contents[![Backers on Open Collective](https://opencollective.com/intellij-elixir/backers/badge.svg)](#backers)[![Sponsors on Open Collective](https://opencollective.com/intellij-elixir/sponsors/badge.svg)](#sponsors)
=================

* [Elixir plugin](#elixir-plugin)
* [IDEs](#ides)
* [Features](#features)
* [Project](#project)
* [From Existing Sources](#from-existing-sources)
* [Import project from external model](#import-project-from-external-model)
* [Create project from existing sources](#create-project-from-existing-sources)
* [New](#new)
* [Project Structure](#project-structure)
* [Project Settings](#project-settings)
* [SDK Setup Known Limitations](#sdk-setup-known-limitations)
* [Windows Subsystem for Linux (WSL) Support](#windows-subsystem-for-linux-wsl-support)
* [WSL Limitations](#wsl-limitations)
* [Module Settings](#module-settings)
* [Sources](#sources)
* [Paths](#paths)
* [Dependencies](#dependencies)
* [New Elixir File](#new-elixir-file)
* [Empty module](#empty-module)
* [Elixir Application](#elixir-application)
* [Elixir Supervisor](#elixir-supervisor)
* [Elixir GenServer](#elixir-genserver)
* [Elixir GenEvent](#elixir-genevent)
* [Syntax Highlighting and Semantic Annotation](#syntax-highlighting-and-semantic-annotation)
* [Grammar parsing](#grammar-parsing)
* [Inspections](#inspections)
* [Ambiguous nested calls](#ambiguous-nested-calls)
* [Ambiguous parentheses](#ambiguous-parentheses)
* [Empty Parentheses](#empty-parentheses)
* [Keywords in Parentheses](#keywords-in-parentheses)
* [Positional arguments in Parentheses](#positional-arguments-in-parentheses)
* [Keyword pair colon (:) used in type spec instead of type operator (::)](#keyword-pair-colon--used-in-type-spec-instead-of-type-operator-)
* [Keywords appear before the end of list.](#keywords-appear-before-the-end-of-list)
* [Match operator (=) used in type spec instead of type operator (::)](#match-operator--used-in-type-spec-instead-of-type-operator-)
* [Quick Fixes](#quick-fixes)
* [Convert : to :: in type specs](#convert--to---in-type-specs)
* [Convert = to :: in type specs](#convert--to---in-type-specs-1)
* [Remove space in front of ambiguous parentheses](#remove-space-in-front-of-ambiguous-parentheses)
* [Code Folding](#code-folding)
* [Controls](#controls)
* [Collapsing](#collapsing)
* [Expanding](#expanding)
* [Regions](#regions)
* [Commenter](#commenter)
* [Credo](#credo)
* [Inspection](#inspection)
* [Batch Mode](#batch-mode)
* [Configuration](#configuration)
* [Annotator](#annotator)
* [Disable Explanation](#disable-explanation)
* [Disable inspection](#disable-inspection)
* [Debugger](#debugger)
* [Steps](#steps)
* [Basics](#basics)
* [Keyboard Shortcuts](#keyboard-shortcuts)
* [Excluding Modules](#excluding-modules)
* [Disabling Existing Module Patterns](#disabling-existing-module-patterns)
* [Editing Existing Module Patterns](#editing-existing-module-patterns)
* [Removing Existing Module Patterns](#removing-existing-module-patterns)
* [Adding New Module Patterns](#adding-new-module-patterns)
* [Environment Variables](#environment-variables)
* [Breakpoints](#breakpoints)
* [Accessing Breakpoint Properties](#accessing-breakpoint-properties)
* [Viewing all breakpoints](#viewing-all-breakpoints)
* [Viewing a single breakpoint](#viewing-a-single-breakpoint)
* [Configuring Breakpoints](#configuring-breakpoints)
* [Creating Line Breakpoints](#creating-line-breakpoints)
* [Describing Line Breakpoints](#describing-line-breakpoints)
* [Searching for Line Breakpoints](#searching-for-line-breakpoints)
* [Jump to Breakpoint Source](#jump-to-breakpoint-source)
* [Disabling Line Breakpoints](#disabling-line-breakpoints)
* [Deleting Line Breakpoints](#deleting-line-breakpoints)
* [Starting the Debugger Session](#starting-the-debugger-session)
* [Examining Suspended Program](#examining-suspended-program)
* [Processes](#processes)
* [Frames](#frames)
* [Jump to Current Execution Point](#jump-to-current-execution-point)
* [Variables](#variables)
* [Evaluate](#evaluate)
* [Stepping](#stepping)
* [Delimiters](#delimiters)
* [Auto-inserting](#auto-inserting)
* [Matching](#matching)
* [Dialyzer](#dialyzer)
* [Inspection](#inspection-1)
* [Batch Mode](#batch-mode-1)
* [Embedded Elixir (EEx) Templates ](/resources/icons/file/eex.svg)
* [Advanced configuration](#advanced-configuration)
* [Live Embedded Elixir (LEEx) Templates ](/resources/icons/file/eex.svg)
* [Advanced configuration](#advanced-configuration-1)
* [Building/Compiling](#buildingcompiling)
* [Settings](#settings)
* [Build Messages](#build-messages)
* [Jump To Source](#jump-to-source)
* [Warnings as Errors](#warnings-as-errors)
* [Individual File](#individual-file)
* [Project](#project-1)
* [Live Templates](#live-templates)
* [Documentation](#documentation)
* [Editor](#editor)
* [Code Blocks](#code-blocks)
* [Toggling Editor to Rendered](#toggling-editor-to-rendered)
* [Rendered View](#rendered-view)
* [Aliases link to Modules](#aliases-link-to-modules)
* [Toggling Rendered to Editor](#toggling-rendered-to-editor)
* [Quick Documentation](#quick-documentation)
* [For a function](#for-a-function)
* [For a function](#for-a-function-1)
* [For a module](#for-a-module)
* [For a type](#for-a-type)
* [Run/Debug Configurations](#rundebug-configurations)
* [Distillery Release CLI Elixir Mix Icon with tapered neck to make a retort as used in distilleries](resources/icons/run/distillery/release-cli.svg)
* [Running](#running)
* [Debugging](#debugging)
* [Elixir Elixir Drop](/resources/icons/run/elixir.svg)
* [Running](#running-1)
* [Debugging](#debugging-1)
* [IEx (Interactive Elixir) ](/resources/icons/run/iex.svg)
* [Running](#running-2)
* [Debugging](#debugging-2)
* [Mix Tasks Elixir Drop mixed in a round-bottom flask](/resources/icons/run/mix.svg)
* [Running](#running-3)
* [Debugging](#debugging-3)
* [IEx Mix IEx Mix](/resources/icons/run/iex/mix.svg)
* [Running](#running-4)
* [Debugging](#debugging-4)
* [Using graphical formatter](#using-graphical-formatter)
* [Creating mix espce Run Configurations Manually](#creating-mix-espce-run-configurations-manually)
* [Running](#running-5)
* [Debugging](#debugging-5)
* [Creating mix espec Run Configurations from context](#creating-mix-espec-run-configurations-from-context)
* [Creating/Running mix espec Run Configurations from directory](#creatingrunning-mix-espec-run-configurations-from-directory)
* [Creating/Running mix espec Run Configurations from file](#creatingrunning-mix-espec-run-configurations-from-file)
* [Creating/Running mix espec Run Configurations from line](#creatingrunning-mix-espec-run-configurations-from-line)
* [Creating mix test Run Configurations Manually](#creating-mix-test-run-configurations-manually)
* [Running](#running-6)
* [Debugging](#debugging-6)
* [Creating mix test Run Configurations from context](#creating-mix-test-run-configurations-from-context)
* [Creating/Running mix test Run Configurations from directory](#creatingrunning-mix-test-run-configurations-from-directory)
* [Creating/Running mix test Run Configurations from file](#creatingrunning-mix-test-run-configurations-from-file)
* [Creating/Running mix test Run Configurations from line](#creatingrunning-mix-test-run-configurations-from-line)
* [Decompression](#decompression)
* [BEAM Chunks](#beam-chunks)
* [Atom / AtU8](#atom--atu8)
* [Format](#format)
* [Tab](#tab)
* [Attr](#attr)
* [Format](#format-1)
* [Tab](#tab-1)
* [CInf](#cinf)
* [Format](#format-2)
* [Tab](#tab-2)
* [Code](#code)
* [Format](#format-3)
* [Tab](#tab-3)
* [Dbgi](#dbgi)
* [Format](#format-4)
* [Tab](#tab-4)
* [ExDc](#exdc)
* [Format](#format-5)
* [Tab](#tab-5)
* [ExpT](#expt)
* [Format](#format-6)
* [Tab](#tab-6)
* [ImpT](#impt)
* [Format](#format-7)
* [Tab](#tab-7)
* [LitT](#litt)
* [Format](#format-8)
* [Tab](#tab-8)
* [Line](#line)
* [Format](#format-9)
* [Tab](#tab-9)
* [LocT](#loct)
* [Format](#format-10)
* [Tab](#tab-10)
* [StrT](#strt)
* [Format](#format-11)
* [Tab](#tab-11)
* [Decompilation (Text)](#decompilation-text)
* [Call definition macros](#call-definition-macros)
* [Special handling of call definition names](#special-handling-of-call-definition-names)
* [Completion](#completion)
* [Aliases and Modules](#aliases-and-modules)
* [Aliases inside { }](#aliases-inside--)
* [Function and Macro Calls](#function-and-macro-calls)
* [Qualified](#qualified)
* [Unqualified](#unqualified)
* [Module Attributes](#module-attributes)
* [Parameters and Variables](#parameters-and-variables)
* [Go To Declaration](#go-to-declaration)
* [Alias](#alias)
* [Function or Macro](#function-or-macro)
* [Imported Functions or Macros](#imported-functions-or-macros)
* [Local Functions or Macros](#local-functions-or-macros)
* [Remote Functions or Macros](#remote-functions-or-macros)
* [Module](#module)
* [Module Attribute](#module-attribute)
* [Parameters and Variables](#parameters-and-variables-1)
* [Formatting](#formatting)
* [Formatters](#formatters)
* [Internal](#internal)
* [External (mix format)](#external-mix-format)
* [Disabling](#disabling)
* [Format on Save](#format-on-save)
* [Autosave](#autosave)
* [Formattables](#formattables)
* [Directory](#directory)
* [File](#file)
* [Other File](#other-file)
* [Current File](#current-file)
* [Selection](#selection)
* [Go To Related](#go-to-related)
* [Decompiled Module](#decompiled-module)
* [Decompiled Call Definition](#decompiled-call-definition)
* [Go To Symbol](#go-to-symbol)
* [Go To Test](#go-to-test)
* [Go To Test Subject](#go-to-test-subject)
* [Find Usages and Show Usages](#find-usages-and-show-usages)
* [Function](#function)
* [Module](#module-1)
* [Module Attribute](#module-attribute-1)
* [Parameters and Variables](#parameters-and-variables-2)
* [Refactor](#refactor)
* [Rename](#rename)
* [Module Attribute](#module-attribute-2)
* [Parameters and Variables](#parameters-and-variables-3)
* [SDK](#sdk)
* [Package Manager Install Locations](#package-manager-install-locations)
* [Rich IDEs](#rich-ides)
* [Default SDK](#default-sdk)
* [Small IDEs](#small-ides)
* [Elixir Facet SDK](#elixir-facet-sdk)
* [Elixir SDKs](#elixir-sdks)
* [Internal Erlang SDK](#internal-erlang-sdk)
* [Show Parameters](#show-parameters)
* [Structure](#structure)
* [Viewing Structure](#viewing-structure)
* [Buttons](#buttons)
* [Sorters](#sorters)
* [Providers](#providers)
* [Expanders](#expanders)
* [Autoscrollers](#autoscrollers)
* [Elements](#elements)
* [Icons](#icons)
* [Time](#time)
* [Visibility](#visibility)
* [Call to Element](#call-to-element)
* [Experimental Features](#experimental-features)
* [~H Sigil HTML Injection Support](#h-sigil-html-injection-support)
* [IntelliLang Plugin Requirement](#intellilang-plugin-requirement)
* [How to Enable ~H Sigil HTML Injection](#how-to-enable-h-sigil-html-injection)
* [Providing feedback and reporting issues for the ~H Sigil HTML Injection Experimental Feature](#providing-feedback-and-reporting-issues-for-the-h-sigil-html-injection-experimental-feature)
* [Removing the Green Background for Injected Language Fragments](#removing-the-green-background-for-injected-language-fragments)
* [Installation](#installation)
* [Stable releases](#stable-releases)
* [Inside IDE using JetBrains repository](#inside-ide-using-jetbrains-repository)
* [Inside IDE using Github releases](#inside-ide-using-github-releases)
* [In browser](#in-browser)
* [In IDE](#in-ide)
* [Canary releases](#canary-releases)
* [Inside IDE using JetBrains repository](#inside-ide-using-jetbrains-repository-1)
* [Inside IDE using Github releases](#inside-ide-using-github-releases-1)
* [In browser](#in-browser-1)
* [In IDE](#in-ide-1)
* [Screenshots](#screenshots)
* [Error reporting](#error-reporting)
* [Contributors](#contributors)
* [Donations](#donations)
* [Historical Statistics](#historical-statistics)
* [Work Time](#work-time)
* [Donors](#donors)
* [Open Collective](#open-collective)
* [Backers](#backers)
* [Sponsors](#sponsors)

# Elixir plugin

[![Build Status](https://travis-ci.org/KronicDeth/intellij-elixir.svg?branch=main)](https://travis-ci.org/KronicDeth/intellij-elixir)

This is a plugin that adds support for [Elixir](http://elixir-lang.org/) to JetBrains IDEs.

The plugin works both in the rich IDEs that allow alternative language SDK selection and small IDEs that are language specific. The rich IDEs work best for IntelliJ Elixir because only in the rich IDEs can have an Elixir SDK set as the Project SDK. In all small IDEs, the native language SDK is always there, which makes anything that uses the SDK, such as running `elixir`, `erl`, or `mix` more complicated both internally and externally in the configuration you have to setup.

## IDEs

*The plugin is free to use in all JetBrains IDEs. The Cost column in the below table is what JetBrains charges for the IDE itself. IntelliJ Elixir is maintained by [@KronicDeth](https://github.com/KronicDeth) who does not get any of the subscription money. If you want to support the plugin itself, make a [donation](#donations).*

| IDE | Rich/Small | Languages | Cost | Trial | License | Source |
|----------------------------------------------------------------------------------------------------------|------------|-------------|---------------------------------------------------------------------------|--------------------------------------------------------------------------------------|----------------------|-----------------------------------------------------------------------------------------------------------------|
| [IntelliJ IDEA Community Edition](https://www.jetbrains.com/idea/download/download-thanks.html?code=IIC) | Rich | Java | Free | N/A | Apache 2.0 | [JetBrains/intellij-community](https://github.com/JetBrains/intellij-community) |
| [IntelliJ IDEA Ultimate Edition](https://www.jetbrains.com/idea/download/download-thanks.html) | Rich | Java | [Subscription](https://www.jetbrains.com/idea/buy/#edition=discounts) | 30-days | Commercial | N/A |
| [AppCode](https://www.jetbrains.com/objc/download/download-thanks.html) | Small | Objective-C | [Subscription](https://www.jetbrains.com/objc/buy/#edition=discounts) | 30-days | Commercial | N/A |
| [CLion](https://www.jetbrains.com/clion/download/download-thanks.html) | Small | C/C++ | [Subscription](https://www.jetbrains.com/clion/buy/#edition=discounts) | 30-days | Commercial | N/A |
| [DataGrip](https://www.jetbrains.com/datagrip/download/download-thanks.html) | Small | SQL | [Subscription](https://www.jetbrains.com/datagrip/buy/#edition=discounts) | 30-days | Commercial | N/A |
| [GoLand](https://www.jetbrains.com/go/download/download-thanks.html) | Small | Go | [Subscription](https://www.jetbrains.com/goland/buy/#edition=discounts) | 30-days | Commercial | N/A |
| [PHPStorm](https://www.jetbrains.com/phpstorm/download/download-thanks.html) | Small | PHP | [Subscription](https://www.jetbrains.com/phpstorm/buy/#edition=discounts) | 30-days | Commercial | N/A |
| [PyCharm Community Edition](https://www.jetbrains.com/pycharm/download/download-thanks.html?code=PCC) | Small | Python | Free | N/A | Apache 2.0 | [JetBrains/intellij-community subdirectory](https://github.com/JetBrains/intellij-community/tree/master/python) |
| [PyCharm Professional Edition](https://www.jetbrains.com/pycharm/download/download-thanks.html) | Small | Python | [Subscription](https://www.jetbrains.com/pycharm/buy/#edition=discounts) | N/A | Commercial | N/A |
| [Rider](https://www.jetbrains.com/rider/download/download-thanks.html) | Small | .NET | [Subcription](https://www.jetbrains.com/rider/buy/#edition=discounts) | N/A | Commercial | N/A |
| [RubyMine](https://www.jetbrains.com/ruby/download/download-thanks.html) | Small | Ruby | [Subscription](https://www.jetbrains.com/ruby/buy/#edition=discounts) | 30-days ([90-day for whole team](https://www.jetbrains.com/ruby/buy/#edition=trial)) | Commercial | N/A |
| [WebStorm](https://www.jetbrains.com/webstorm/download/download-thanks.html) | Small | JavaScript | [Subscription](https://www.jetbrains.com/webstorm/buy/#edition=discounts) | 30-days | Commercial | N/A |

Once you have your IDE of choice installed, you can [install this plugin](#installation)

## Features

| Feature | [Rich](#ides) | [Small](#ides) | Alternative |
|---------------------------------------------|---------------|----------------|-------------------------------------------------------|
| Project | Yes | No | 1. Open directory
2. [Setup the SDK](#small-ides) |
| Project Structure | Automatic | Manual | |
| Project Settings | Yes | No | |
| Module Settings | Yes | No | |
| New Elixir File | Yes | Yes | |
| Syntax Highlighting and Semantic Annotation | Yes | Yes | |
| Grammar Parsing | Yes | Yes | |
| Inspections | Yes | Yes | |
| Quick Fixes | Yes | Yes | |
| Code Folding | Yes | Yes | |
| Commenter | Yes | Yes | |
| Debugger | Yes | Yes | |
| Delimiters | Yes | Yes | |
| Embedded Elixir (EEx) Templates | Yes | Yes | |
| Building/Compiling | Yes | No | Build/compile as part `mix` run configurations only |
| Live Templates | Yes | Yes | |
| Documentation | Yes | Yes | |
| Run Configurations | Yes | Yes | |
| Completion | Yes | Yes | |
| Decompilation | Yes | Yes | |
| Go To Declaration | Yes | Yes | |
| Formatting | Yes | Yes | |
| Go To Related | Yes | Yes | |
| Go To Symbol | Yes | Yes | |
| Go To Test | Yes | Yes | |
| Go To Test Subject | Yes | Yes | |
| Find Usage | Yes | Yes | |
| Live Embedded Elixir (LEEx) Templates | Yes | Yes | |
| Refactor | Yes | Yes | |
| SDK | Yes | Yes | |
| Structure | Yes | Yes | |

### Project

NOTE: This feature only works in Rich IDEs as it depends on an extension point unavailable in Small IDEs. To setup a project in a Small IDE

1. Open Directory of the project
2. [Setup the SDK](#small-ides)

#### From Existing Sources

##### Import project from external model
If you've already created a `mix` project, you can load it as an Elixir project into the plugin.

1. File > New > Project From Existing Sources...
2. Select the root directory of your project.
3. Select "Import project from external model"
4. Select Mix

![File > New Project > From Existing Sources > Import project from external model > Mix](/screenshots/features/project/from_existing_sources/import_project_from_external_model/Mix.png?raw=true "Import Mix Project")
5. Click Next
6. Select a Project SDK directory by clicking Configure.
7. The plugin will automatically find the newest version of Elixir installed. (**NOTE: SDK detection only works for
Linux, homebrew installs on OSX, and Windows. [Open an issue](https://github.com/KronicDeth/intellij-elixir/issues)
with information about Elixir install locations on your operating system and package manager to have SDK detection
added for it.**)
8. If the automatic detection doesn't find your Elixir SDK or you want to use an older version, manually select select
the directory above the `bin` directory containing `elixir`, `elixirc`, `iex`, and `mix`. (On Windows it is the
directory containing `elixir.bat`, `elixirc.bat`, `iex.bat`, and `mix.bat`.)
9. Click Finish after you select SDK name from the Project SDK list.
10. The "Mix project root" will be filled in with the selected directory.
11. (Optional) Uncheck "Fetch dependencies with mix" if you don't want to run `mix deps.get` when importing the project
* If "Fetch dependencies with mix" is checked both `mix local.hex --force` and `mix deps.get` will be run.
12. Click Next
13. All directories with `mix.exs` files will be selected as "Mix projects to import". To import just the main project and not its dependencies, click Unselect All.
14. Check the box next to the project root to use only its `mix.exs`. (It will likely be the first checkbox at the top.)
15. Click Finish

##### Create project from existing sources
If you've already created a (non-`mix`) project, you can load it as an Elixir project into the plugin.

1. File > New > Project From Existing Sources...
2. Select the root directory of your project.
3. Leave the default selection, "Create project from existing sources"
4. Click Next
5. Project name will be filled with the basename of the root directory. Customize it if you like.
6. Project location will be the root directory.
7. Click Next.
8. If you previously opened the directory in IntelliJ or another JetBrains IDE, you'll be prompted to overwrite the
.idea directory. Click Yes.
9. You'll be prompted with a list of detected Elixir project roots to add to the project. Each root contains a
`mix.exs`. Uncheck any project roots that you don't want added.
10. Click Next.
11. Select a Project SDK directory by clicking Configure.
12. The plugin will automatically find the newest version of Elixir installed. (**NOTE: SDK detection only works for
Linux, homebrew installs on OSX, and Windows. [Open an issue](https://github.com/KronicDeth/intellij-elixir/issues)
with information about Elixir install locations on your operating system and package manager to have SDK detection
added for it.**)
13. If the automatic detection doesn't find your Elixir SDK or you want to use an older version, manually select select
the directory above the `bin` directory containing `elixir`, `elixirc`, `iex`, and `mix`.
14. Click Next after you select SDK name from the Project SDK list.
15. Click Finish on the framework page. (*No framework detection is implemented yet for Elixir.*)
16. Choose whether to open in a New Window or in This Window.

#### New

If you want to create a basic (non-`mix`) Elixir project with a `lib` directory, perform the following steps.

1. File > New > Project

![File > New > Project](/screenshots/features/project/New.png?raw=true "New Project")
2. Select Elixir from the project type menu on the left
3. Click Next

![File > New > Project > Elixir](/screenshots/features/project/new/Elixir.png?raw=true "New Elixir Project")
4. Select a Project SDK directory by clicking Configure.

![Project SDK](/screenshots/features/project/SDK.png?raw=true "Project SDK")
5. Select a Project SDK directory by clicking Configure.
6. The plugin will automatically find the newest version of Elixir installed.
* macOS / OSX
* Homebrew (`/usr/local/Cellar/elixir`)
* Nix (`/nix/store`)
* Linux
* `/usr/local/lib/elixir`
* Nix and NixOS (`/nix/store`)
* Windows
* 32-bit (`C:\Program Files\Elixir`)
* 64-bit (`C:\Program Files (x86)\Elixir`)
* (**NOTE: SDK detection only works for [Open an issue](https://github.com/KronicDeth/intellij-elixir/issues) with information about Elixir install locations on your operating system and package manager to have SDK detection added for it.**)
7. If the automatic detection doesn't find your Elixir SDK or you want to use an older version, manually select select the directory above the `bin` directory containing `elixir`, `elixirc`, `iex`, and `mix`. If the `bin`, `lib,` or `src` directory is incorrectly selected, it will be corrected to the parent directory.
8. Click Next after you select SDK name from the Project SDK list.
9. Change the `Project name` to the name your want for the project
![File > New > Project > Settings](/screenshots/features/project/new/Settings.png?raw=true "New Elixir Project Settings")
10. (Optionally) change the `Project location` if the directory does not match what you want
11. (Optionally) expand `More Settings` to change the `Module name`, `Content root`, `Module file location`, and/or `Project format`. The defaults derived from the `Project name` and `Project location` should work for most projects.
12. Click Finish
13. Choose whether to open in a New Window or in This Window.
![File > New > Project > Window](/screenshots/features/project/new/Settings.png?raw=true "Open Project in New Window or This Window")

### Project Structure

![Project View](/screenshots/Project%20View.png?raw=true "Project View")

* Excluded
* `_build` (Output from `mix`)
* `rel` (Output from `exrm`)
* Sources
* `lib`
* Test Sources
* `test`

### Project Settings

![Project Settings](/screenshots/project_settings/Project.png?raw=true "Project Settings")

The Project Settings include
* Project Name
* Project SDK

#### SDK Setup Known Limitations

When setting up Elixir and Erlang SDKs for the first time:

* **Setup SDKs before importing your Elixir project**
* **Auto-detect SDKs**: The plugin will attempt to automatically detect the SDKs based on the currently open project directory, not the directory that you are importing. To setup SDKs on a WSL instance, open any project, or even an empty directory in WSL first.
* **Click OK directly** after configuring Erlang, then reopen the Project Structure dialog to configure Elixir - this will properly save all settings
* **Avoid clicking Apply then OK** - this workflow has a known issue where the project SDK may not be saved correctly

### Windows Subsystem for Linux (WSL) Support

The plugin supports running Elixir, Mix, and IEx commands within WSL. This includes:

* **Run Configurations**: All Mix, ExUnit, ESpec, Elixir, and IEx run configurations are fully compatible with WSL.
* **External Tools**: background tools like Credo inspections, Dialyzer, Mix Format, and the New Project Wizard automatically use WSL when your project is located on a WSL partition.
* **Path Conversion**: Windows UNC paths (e.g., `\\wsl$\Ubuntu\...`) and Windows drive paths are automatically converted to POSIX paths when executing commands in WSL.

#### WSL Limitations

* **New Project Wizard**: SDK selection is based on the location of the currently open project, not the new project. To select a WSL based SDK during the New Project Wizard, open any WSL project or directory in the IDE first.
* **SDKs and Project must all be on the same WSL Distribution**: You cannot use a WSL based SDK with a non-WSL project, and vice versa. You can use the `/mnt/c` drive to access Windows files from WSL, but the performance is terrible.
* **Build system (Ctrl+F9)**: The IDE build system only works when the **Project SDK** is set to a **JDK 21+** in the same WSL distribution, and all **Module SDKs** are set to the correct **Elixir SDK**.
* **Performance**: Running the IDE in Windows with a WSL project is slower than running the IDE directly in the WSL instance. This is a limitation of the IDE, not specific to the Elixir plugin.

### Module Settings

#### Sources

![Module Settings > Sources](/screenshots/project_settings/module/Sources.png?raw=true "Module Sources")

The Module Settings include Marking directories as
* Excluded
* Sources
* Tests

#### Paths

![Module Settings > Paths](/screenshots/project_settings/module/Paths.png?raw=true "Module Paths")

Module paths list the output directories when compiling code in the module. There is a an "Output path" for `dev`
`MIX_ENV` and "Test output path" for the `test` `MIX_ENV`.

#### Dependencies

![Module Settings > Dependencies](/screenshots/project_settings/module/Dependencies.png?raw=true "Module Dependencies")

Module dependencies are currently just the SDK and the sources for the module. Dependencies in `deps` are not
automatically detected at this time.

### New Elixir File

1. Right-click a directory (such as `lib` or `test` in the standard `mix new` layout)
2. Select New > Elixir File.

![New > Elixir File](/screenshots/features/new/Elixir%20File.png?raw=true "New Elixir File")
3. Enter an Alias for the Module name, such as `MyModule` or `MyNamespace.MyModule`.
4. Select a Kind of Elixir File to use a different template.

![New > Elixir File > Kind](/screenshots/features/new/elixir_file/Kind.png?raw=true "New Elixir File Kind")

#### Empty module

An underscored file will be created in an underscored directory `lib/my_namespace/my_module.ex`) with the given module
name with be created:

```elixir
defmodule MyNamespace.MyModule do
@moduledoc false

end
```

#### Elixir Application

An underscored file will be created in an underscored directory `lib/my_namespace/my_module.ex`) with the given module
name with be created. It will have a `start/2` function that calls `MyNamespace.MyModule.Supervisor.start_link/0`.

```elixir
defmodule MyNamespace.MyModule do
@moduledoc false

use Application

def start(_type, _args) do
MyNamespace.MyModule.Supervisor.start_link()
end
end
```

#### Elixir Supervisor

An underscored file will be created in an underscored directory `lib/my_namespace/my_module.ex`) with the given module
name with be created. It will have a `start_link/1` function that calls `Supervisor.start_link/0` and `init/1` that sets
up the child specs. It assumes a `MyWorker` child that should be supervised `:one_for_one`.

```elixir
defmodule MyNamespace.MyModule.Supervisor do
@moduledoc false

use Supervisor

def start_link(arg) do
Supervisor.start_link(__MODULE__, arg)
end

def init(arg) do
children = [
worker(MyWorker, [arg], restart: :temporary)
]

supervise(children, strategy: :one_for_one)
end
end
```

#### Elixir GenServer

An underscored file will be created in an underscored directory `lib/my_namespace/my_module.ex`) with the given module
name with be created. It will have a `start_link/2` function that calls `GenServer.start_link/3` and the minimal
callback implementations for `init/1`, `handle_call/3`, and `handle_cast/2`.

The Elixir `use GenServer` supplies these callbacks, so this template is for when you want to change the callbacks, but
would like the stubs to get started without having to look them up in the documentation.

```elixir
defmodule MyNamespace.MyModule do
@moduledoc false

use GenServer

def start_link(state, opts) do
GenServer.start_link(__MODULE__, state, opts)
end

def init(_opts) do
{:ok, %{}}
end

def handle_call(_msg, _from, state) do
{:reply, :ok, state}
end

def handle_cast(_msg, state) do
{:noreply, state}
end
end
```

#### Elixir GenEvent

An underscored file will be created in an underscored directory `lib/my_namespace/my_module.ex`) with the given module
name with be created. The minimal callback implementations for `init/1`, `handle_event/2`, and `handle_call/2`,
`handle_info/2`.

The Elixir `use GenEvent` supplies these callbacks, so this template is for when you want to change the callbacks, but
would like the stubs to get started without having to look them up in the documentation.

```elixir
defmodule MyNamespace.MyModule do
@moduledoc false

use GenEvent

# Callbacks

def init(_opts) do
{:ok, %{}}
end

def handle_event(_msg, state) do
{:ok, state}
end

def handle_call(_msg, state) do
{:ok, :ok, state}
end

def handle_info(_msg, state) do
{:ok, state}
end
end
```

### Syntax Highlighting and Semantic Annotation

Syntax highlighting of lexer tokens and semantic annotating of parser elements can be customized in in the Color Settings page for Elixir (Preferences > Editor > Color & Fonts > Elixir).



Text Attribute Key Display Name
Tokens/Elements
Scheme


Default
Darcula




Alias


String

Alias color scheme in default theme


Alias color scheme in Darcula theme



Atom




  • :one

  • <<>>:




Atom color scheme in default theme


Atom color scheme in Darcula theme



Braces and Operators
Bit



  • <<

  • >&gt




Bit operator color scheme in default theme


Bit operator color scheme in Darcula theme



Braces and Operators
Braces



  • {

  • }




Braces color scheme in default theme


Braces color scheme in Darcula theme



Braces and Operators
Brackets



  • [

  • ]




Brackets color scheme in default theme


Brackets color scheme in Darcula theme



Braces and Operators
Character Token

?

Character Token color scheme in default theme


Character Token color scheme in Darcula theme



Braces and Operators
Comma

,

Comma color scheme in default theme


Comma color scheme in Darcula theme



Braces and Operators
Dot

.

Dot operator color scheme in default theme


Dot operator color scheme in Darcula theme



Braces and Operators
Interpolation



  • #{

  • }




Interpolation color scheme in default theme


Interpolation color scheme in Darcula theme



Braces and Operators
Maps and Structs
Maps


  • %{

  • }




Maps color scheme in default theme


Maps color scheme in Darcula theme



Braces and Operators
Maps and Structs
Maps


  • %

  • {

  • }



Structs color scheme in default theme


Structs color scheme in Darcula theme



Braces and Operators
Operation Sign



  • =

  • +

  • *

  • ==

  • !

  • &&

  • ||

  • |>

  • ^




Operation Sign color scheme in default theme


Operation Sign color scheme in Darcula theme



Braces and Operators
Parentheses



  • (

  • )




Parentheses color scheme in default theme


Parentheses color scheme in Darcula theme



Braces and Operators
Semicolon

;

Semicolon color scheme in default theme


Semicolon color scheme in Darcula theme



Calls
Function

inspect

Function call color scheme in default theme*Only the Italic attribute


Function call color scheme in Darcula theme*Only the Italic attribute



Calls
Macro

inspect

Macro call color scheme in default theme*Only the Bold and Italic attributes


Macro call color scheme in Darcula theme*Only the Bold and Italic attributes



Calls
Predefined




  • Kernel

    • functions

    • macros




  • Kernel.SpecialForms

    • macros






Predefined call color scheme in default theme*Only the Foreground attribute


Predefined call color scheme in Darcula theme*Only the Foreground attribute



Comment


# Numbers

Comment color scheme in default theme


Comment color scheme in Darcula theme



Keywords


end

Keywords color scheme in default theme


Keywords color scheme in Darcula theme



Module Attributes


@custom_attr

Module Attributes color scheme in default theme


Module Attributes color scheme in Darcula theme



Module Attributes
Documentation

@doc

Documentation attribute color scheme in default theme


Documentation attribute color scheme in Darcula theme



Module Attributes
Documentation
Text
Simple module docstring

Documentation text color scheme in default theme


Documentation text color scheme in Darcula theme



Module Attributes
Types
Callback
func

Callback type color scheme in default theme


Callback type color scheme in Darcula theme



Module Attributes
Types
Specification
func

Specification type color scheme in default theme


Specification type color scheme in Darcula theme



Module Attributes
Types
Type
parameterized

Type definition color scheme in default theme


Type definition color scheme in Darcula theme



Module Attributes
Types
Type Parameter
type_parameter

Type Parameter color scheme in default theme


Type Parameter color scheme in Darcula theme



Numbers
Base Prefix
Non-Decimal


  • 0b

  • 0x

  • 0o




Non-Decimal base prefix color scheme in default theme


Non-Decimal base prefix color scheme in Darcula theme



Numbers
Base Prefix
Obsolete Non-Decimal


  • 0B

  • 0X




Obsolete Non-Decimal base prefix color scheme in default theme


Obsolete Non-Decimal base prefix color scheme in Darcula theme



Numbers
Decimal Exponent, Mark, and Separator



  • e

  • .

  • _




Decimal Exponent, Mark, and Separator color scheme in default theme


Decimal Exponent, Mark, and Separator color scheme in Darcula theme



Numbers
Digits
Invalid


  • 2

  • o

  • r

  • 888




Invalid digits color scheme in default theme


Invalid digits color scheme in Darcula theme



Numbers
Digits
Valid


  • 1234

  • 1A

  • beef

  • 123




Valid digits color scheme in default theme


Valid digits color scheme in Darcula theme



Textual
Character List


'This is a list'


Character List color scheme in default theme


Character List color scheme in Darcula theme



Textual
Escape Sequence


\x{12}


Escape Sequence color scheme in default theme


Escape Sequence color scheme in Darcula theme



Textual
Sigil



  • ~r//

  • ~R''

  • ~w()

  • ~W()




Sigil color scheme in default theme


Sigil color scheme in Darcula theme



Textual
String


"Hello world"


String color scheme in default theme


String color scheme in Darcula theme



Variables
Ignored


_


Ignored variables color scheme in default theme


Ignored variables color scheme in Darcula theme



Variables
Parameter



  • a

  • b




Parameter variables color scheme in default theme


Parameter variables color scheme in Darcula theme



Variables
Variable


pid


Variable color scheme in default theme


Variable color scheme in Darcula theme


### Grammar parsing

Built on top of highlighted tokens above, the parser understands the following parts of Elixir grammar as valid or
allows the grammar because they contain correctable errors:

* [Empty Parentheses](https://github.com/elixir-lang/elixir/blob/de39bbaca277002797e52ffbde617ace06233a2b/lib/elixir/src/elixir_parser.yrl#L299) (`()`)
* [Keyword Lists](http://elixir-lang.org/getting_started/7.html#7.1-keyword-lists)
* Keyword Keys - Aliases, identifiers, quotes, or operators when followed immediately by a colon and horizontal or vertical space.
* Keyword Values - Empty parentheses (`()`) and matched expressions.
* [Matched Expressions](https://github.com/elixir-lang/elixir/blob/de39bbaca277002797e52ffbde617ace06233a2b/lib/elixir/src/elixir_parser.yrl#L113-L122),
in other words, unary and binary operations on variable, function, and macro names and values (numbers, strings,
char lists, sigils, heredocs, `true`, `false`, and `nil`).
* [No Parentheses expressions](https://github.com/elixir-lang/elixir/blob/de39bbaca277002797e52ffbde617ace06233a2b/lib/elixir/src/elixir_parser.yrl#L124-L125), which
are function calls with neither parentheses nor `do` blocks that have either (1) a positional argument and keyword
arguments OR (2) two or more positional arguments with optional keyword arguments.
* Anonymous function calls `.()` with either no arguments; a no parentheses arguments expression as an argument; keywords
as an argument; positional argument(s); or positional arguments followed by keywords as arguments.
* Remote function calls (`Alias.function`, `:atom.function`, etc) and local function calls (`function`) with...
* No Parentheses with...
* No Arguments (`Alias.function`)
* Keywords (`Alias.function key: value`)
* Nested No Parentheses Call (`Alias.function Inner.function positional, key: value`)
* Positional and Keyword arguments (`Alias.function positional, key: value`)
* Matched Expression (`Alias.function 1 + 2`)
* Parentheses with...
* No arguments (`Alias.function()`)
* No Parentheses Call (`Alias.function(Inner.function positional, key: value`)
* Keywords (`Alias.function(key: value)`)
* Positional and Keyword arguments (`Alias.function(positional, key: value)`)
* Trailing parentheses for quoting (`def unquote(variable)(positional)`)
* Bracket expression (`variable[key]`)
* Block expressions (`function do end`)
* [Unmatched expressions](https://github.com/elixir-lang/elixir/blob/de39bbaca277002797e52ffbde617ace06233a2b//lib/elixir/src/elixir_parser.yrl#L127-L133),
in other words combinations of block expressions and matched expressions.

### Inspections

Inspections mark sections of code with warnings and errors. They can be customized from the Preferences > Inspections > Elixir.

![Elixir Inspections](/screenshots/inspection/Elixir.png?raw=true "Elixir Inspections")

#### Ambiguous nested calls

Detects when compiler will throw `unexpected comma. Parentheses are required to solve ambiguity in nested calls`.
Function calls with multiple arguments without parentheses cannot take as arguments functions with multiple arguments
without parentheses because which functional gets which arguments is unclear as in the following example:

```elixir
outer_function first_outer_argument,
# second argument is another function call without parentheses, but with multiple arguments
inner_function first_inner_argument,
ambiguous_keyword_key: ambiguous_keyword_value
```

To fix the ambiguity if `first_inner_keyword_key: first_inner_keyword_value` should be associated, add parentheses
around the inner function's arguments:

```elixir
# keywords are for inner function
outer_function first_outer_argument
inner_function(
first_inner_argument
ambiguous_keyword_key: ambiguous_keyword_value
)

# keywords are for outer function
outer_function first_outer_argument
inner_function(
first_inner_argument
),
ambiguous_keyword_key: ambiguous_keyword_value
```

Ambiguous nested calls preferences



Preferences > Inspections > Elixir > Ambiguous nested calls

Ambiguous nested calls error



Ambiguous nested call inspection marks the error on the comma that causes the ambiguity.

Ambiguous nested calls inspection



Mousing over the comma marked as an error in red (or over the red square in the right gutter) will show the inspection
describing the error.

#### Ambiguous parentheses

Detects when compiler will throw `unexpected parenthesis. If you are making a function call, do not insert spaces in between the function name and the opening parentheses`.
Function calls with space between the function name and the parentheses cannot distinguish between function calls with
parentheses, but with an accidental space before the `(` and function calls without parentheses where the first
positional argument is in parentheses.

##### Empty Parentheses
```elixir
function ()
```

To fix the ambiguity remove the space or add outer parentheses without the space if the first argument should be `()`:
```elixir
# extra space, no arguments to function
function()

# first argument is `()`
function(())
```

##### Keywords in Parentheses
```elixir
function (key: value)
```

Keywords inside parentheses is not valid, so the only way to fix this is to remove the space

```elixir
function(key: value)
```

##### Positional arguments in Parentheses

```elixir
function (first_positional, second_positional)
```

A list of positional arguments in parenthenses is not valid, so the only way to fix this is to remove the space

```elixir
function(first_positional, second_positional)
```

Ambiguous parentheses preferences



Preferences > Inspections > Elixir > Ambiguous parentheses

Ambiguous parentheses error



Ambiguous parentheses inspection marks the error on the parenthetical group surrounded by the parentheses that are
ambiguous due to the preceding space.

Ambiguous parentheses



Mousing over the parenthetical group marked as an error in red (or over the red square in the right gutter) will
show the inspection describing the error.

#### Keyword pair colon (`:`) used in type spec instead of type operator (`::`)

Type specifications separate the name from the definition using `::`.

```elixir
@type name: definition
```

Replace the `:` with ` ::`

```elixir
@type name :: definition
```

#### Keywords appear before the end of list.

```elixir
one.(
one,
two positional, key: value,
three
)
```

Keywords can only appear at the end of an argument list, so either surround the no parentheses expression argument with
parentheses, or move the the keywords to the end of the list if it wasn't meant to be a no parentheses expression.

```elixir
one.(
one
two(positional, key: value),
three
)
```

OR

```elixir
one.(
one,
two,
three,
key: value
)
```

Keywords Not At End



Preferences > Inspections > Elixir > Keywords Not At End

Keywords Not At End error



Keywords Not At End inspection marks the error over the keywords that need to be surrounded by parentheses or moved
to the end of the list.

Keywords Not At End inspection



Mousing over the keywords marked as an error in red (or over the red square in the right gutter) will
show the inspection describing the error.

#### Match operator (`=`) used in type spec instead of type operator (`::`)

Type specifications separate the name from the definition using `::`.

```elixir
@type name = definition
```

Replace the `=` with ` ::`

```elixir
@type name :: definition
```

### Quick Fixes

Quick Fixes are actions IntelliJ can take to change your code to correct errors (accessed with Alt+Enter by default).

#### Convert `:` to ` ::` in type specs

If a type specification uses a single `:` instead of `::`, then hit Alt+Enter on the `:` to change it to ` ::` and fix the type spec.

#### Convert `=` to ` ::` in type specs

If a type specification uses `=` instead of `::`, then hit Alt+Enter on the `=` to change it to `::` and fix the type spec.

#### Remove space in front of ambiguous parentheses

If a set of parentheses is marked as ambiguous then the space before it can be removed to disambiguate the parentheses
with Alt+Enter. (Will vary based on keymap.)

Remove spaces before ambiguous parentheses



Hitting Alt+Enter on ambiguous parentheses error will bring up the Local Quick Fix,
"Remove spaces between function name and parentheses". Hit Enter to accept and remove the space.

### Code Folding

You can collapse (fold) pre-defined regions of your Elixir code to make it easier to quickly scroll through files or hide details you don't care about right now.

#### Controls

##### Collapsing

1. Position cursor between lines with with downward facing - arrow and upward facing - arrow.
2. Cmd+-

##### Expanding

1. Position cursor on the collapsed line with the square +
2. Cmd++

#### Regions

| Expanded | Collapsed | Folded By Default? |
|-----------------------------------|--------------------------------------------|--------------------|
| `do end` | `do: ...` | No |
| `->` and right operand | `-> ...` | No |
| `@doc VALUE ` | `@doc "..."` | No |
| `@moduledoc VALUE` | `@moduledoc "..."` | No |
| `@typedoc VALUE` | `@typedoc "..."` | No |
| alias ALIAS1
alias ALIAS1 | `alias ...` | Yes |
| import ALIAS1
import ALIAS2 | `import ...` | Yes |
| require ALIAS1
require ALIAS2 | `require ...` | Yes |
| use ALIAS1
use ALIAS2 | `use ALIAS1` | Yes |
| `@for` | `FOR` in `defimpl PROTOCOL, for: FOR` | Yes |
| `@protocol` | `PROTOCOL` in `defimpl PROTOCOL, for: FOR` | Yes |
| @MODULE_ATTRIBUTE | VALUE in `@MODULE_ATTRIBUTE VALUE` | No |

### Commenter

You can comment or uncomment the current line or selected block of source. By selecting a block of source first you can
quickly comment out and entire function if you're trying to track down a compiling or testing error that's not giving a
helpful line number.

Using the menus

1. Highlight one or more lines
2. Comment (or Uncomment) with one of the following:
a. Code > Comment with Line Comment
b. On OSX the key binding is normally `Cmd+/`.

### Credo

#### Inspection

##### Batch Mode

If you'd like to run `mix credo` use can run it as a global Inspection.

1. Analyze > Run Inspection By Name... (⌥⇧⌘I)
2. Type "Credo"
3. Select "Credo" from the shortened list
4. Hit Enter.

You'll be presented with a "Run 'Credo'" dialog

![Run 'Credo'](/screenshots/features/credo/inspection/batch_mode/Run%20Credo%20Custom%20Scope%20Project%20Production%20Files.png?raw=true)

1. Change the "Inspection scope" from "Whole project", which would include the `deps` to "Custom scope"
2. Select "Project Production Files" from the "Custom scope" dropdown
3. Click "OK"

The Inspections Result Tool Pane will open and show results as each file is processed.

1. Click the ▶ to expand the Credo section to show all warnings

![Individual Entry](/screenshots/features/credo/inspection/batch_mode/Individual%20Entry.png?raw=true)
2. Click an entry for the details of an individual warning with a code highlighting.

![Code Highlighting](/screenshots/features/credo/inspection/batch_mode/Code%20Highlighting.png?raw=true)

The view will show the parts of the file that aren't annotated as collapsed with the discontinuous line number indicating the jumps.

If you click on + collapse markers, you can expand the collapsed sections to see the full context

![Expansion](/screenshots/features/credo/inspection/batch_mode/Expansion.png?raw=true)

Or you can hover over the collapsed section to see a tooltip preview of the expansion

![Expansion Preview](/screenshots/features/credo/inspection/batch_mode/Expansion%20Preview.png?raw=true)

#### Configuration




Preferences > Editor > Inspections


Preferences > Editor > Inspections > Credo


Editor


Inspections




Elixir > Credo


Include Explanation


Highlight


Message


Explanation in tooltip


mix credo Runs


Highlight


Message


mix credo Runs


Action




Per File


Per Issue


Working Directory


Inspect Code


Run Inspection By Name












Yes


Yes


Yes


1


1


Yes


Yes


1


Yes


Yes










Yes


Yes


No


1


0


Yes


Yes


1


Yes


Yes







ⁿ/ₐ


No


No


No


0


0


Yes


Yes


1


No


Yes


#### Annotator
If you want to limit the performance impact of the credo annotator because `mix credo` spikes your CPU, you can limit the number of `mix credo` runs to 1 per open file by disabling the Explanation tooltip

##### Disable Explanation
1. Preferences > Editor > Inspections > Credo
2. Uncheck "Include Explanation"

##### Disable inspection
If you don't want the annotator to run at all on open editors, then you can disable the paired inspection

1. Preferences > Editor > Inspections
2. Uncheck Elixir > Credo

Once the annotator is disabled, you can still run the inspection in [batch mode](#batch-mode)

### Debugger

IntelliJ Elixir allows for graphical debugging of `*.ex` files using line breakpoints.

Line breakpoints for debugger can be set in gutter of editor tab.



Line breakpoints can added by clicking in the left-hand gutter of an
editor tab. A red dot will appear marking the breakpoint. When a
Run Configuration is Run with the Debug (bug) instead of Run (arrow)
button, execution will stop at the breakpoint and you can view the
local variables (with Erlang names) and the stackframes.

#### Steps

1. Define a [run/debug configuration](#rundebug-configurations)
2. [Create breakpoints](#creating-line-breakpoints) in the `*.ex` files
3. [Launch](#starting-the-debugger-session) a debugging session
4. During the debugger session, [step through the breakpoints](#stepping), [examine suspended program](#examining-suspended-program), [explore frames](#frames), and [evaluate code when suspended](#evaluate).

#### Basics

After you have configured a [run configuration](#rundebug-configurations) for your project, you can launch it in debug mode by pressing `Ctrl+D`.

##### Keyboard Shortcuts

| Action | Keyword Shortcut |
|-----------------------------------------|------------------|
| Toggle Breakpoint | `Cmd+F8` |
| Resume Program | `Alt+Cmd+R` |
| Step Over | `F8` |
| Step Into | `F7` |
| View breakpoint details/all breakpoints | `Shift+Cmd+F8` |

##### Excluding Modules

By default, the debugger will scan all the [load paths](https://hexdocs.pm/mix/Mix.Project.html#load_paths/1) and [build path](https://hexdocs.pm/mix/Mix.Project.html#build_path/1) for `.beam` files and the corresponding modules will be [interpreted](http://erlang.org/doc/man/int.html#ni-1) which causes the Module's [Erlang abstract code chunk](http://beam-wisdoms.clau.se/en/latest/indepth-beam-file.html#abst-abstract-syntax-tree) to be interpreted in Erlang instead of the [bytecode chunk](#code) being executed in the C parts of the BEAM. This interpretation is **much** slower than execution, so by default all of the Elixir standard library and the common modules installed in Phoenix projects are excluded from being interpreted when the debugger starts. The modules can be still be stepped into or have breakpoints explicitly set.

1. Preferences > Build, Execution, Deployment > Debugger > Stepping
2. Scroll to Elixir

![Do Not Step Into The Modules](screenshots/debugger/excluding_modules/Do%20Not%20Step%20Into%20The%20Modules.png?raw=true)

You can customize these module patterns as an application setting.

###### Disabling Existing Module Patterns

1. Preferences > Build, Execution, Deployment > Debugger > Stepping
2. Scroll to Elixir
3. Click the Checkbox next to the pattern you want to disable
4. Click Apply to save or OK to save and close Preferences

![Disable](screenshots/debugger/excluding_modules/Disable.png)

###### Editing Existing Module Patterns

1. Preferences > Build, Execution, Deployment > Debugger > Stepping
2. Scroll to Elixir
3. Click the pattern text box
4. Click Apply to save or OK to save and close Preferences

![Edit](screenshots/debugger/excluding_modules/Edit.png?raw=true)

###### Removing Existing Module Patterns

1. Preferences > Build, Execution, Deployment > Debugger > Stepping
2. Scroll to Elixir
3. Click the row of the pattern you want to remove
4. Click the "-" Remove button.
5. Click Apply to save or OK to save and close Preferences

![Remove](screenshots/debugger/excluding_modules/Remove.png?raw=true)

![Removed](screenshots/debugger/excluding_modules/Removed.png?raw=true)

###### Adding New Module Patterns

1. Preferences > Build, Execution, Deployment > Debugger > Stepping
2. Scroll to Elixir
3. Click the "+" Add button
4. Click the default "*" pattern to edit it
5. Click Apply to save or OK to save and close Preferences

![Add](screenshots/debugger/excluding_modules/Add.png?raw=true)

![Added](screenshots/debugger/excluding_modules/Added.png?raw=true)

##### Environment Variables

If you want to customize the modules to ignore on a per-Run-Configuration basis, you can set an environment variable in the Run Configuration.

| Variable | Example | Description |
|------------------------------------|------------|---------------------------------|
| INTELLIJ\_ELIXIR\_DEBUG\_BLACKLIST | iconv,some | Excluding modules from debugger |

*Notice: If you want non `Elixir.` module in blacklist, write it with: `:`. This rule applies only to module atoms.*

#### Breakpoints

When a breakpoint is set, the editor displays a breakpoint icon in the gutter area to the left of the affected source code. A breakpoint icon denotes status of a breakpoint, and provides useful information about its type, location, and action.

The icons serve as convenient shortcuts for managing breakpoints. Clicking an icon removes the breakpoint. Successive use of Alt - click on an icon toggles its state between enabled and disabled. The settings of a breakpoint are shown in a tooltip when a mouse pointer hovers over a breakpoint icon in the gutter area of the editor.

| Status | Icon | Description |
|------------------------|-------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|
| Enabled | Red dot | Indicates the debugger will stop at this line when the breakpoint is hit. |
| Disabled | Red dot with green dot in center | Indicates that nothing happens when the breakpoint is hit. |
| Conditionally Disabled | Red dot with green dot in top-left corner | This state is assigned to breakpoints when they depend on another breakpoint to be activated. |

When the button Red dot surrounded by crossed-out circle is pressed in the toolbar of the Debug tool window, all the breakpoints in a project are muted, and their icons become grey: Grey dot.

##### Accessing Breakpoint Properties

###### Viewing all breakpoints

To view the list of all breakpoints and their properties, do one of the following:

* Run > View Breakpoints
* `Shift+Cmd+F8`
* Click the Two red dots layered vertically on top of each other with smaller grey rings to right of the red dots
* Breakpoints are visible in the Favorites tool window.

###### Viewing a single breakpoint

To view properties of a single breakpoint

* Right-Click a breakpoint icon in the left gutter of the editor.
Breakpoint properties dialog

##### Configuring Breakpoints

To configure actions, suspend policy and dependencies of a breakpoint

1. Open the Breakpoint Properties
* Right-click a breakpoint in the left gutter, then click the More link or press `Shift+Cmd+F8`
* Open the [Breakpoints](#viewing-all-breakpoints) dialog box and select the breakpoint from the list
* In the Favorites tool window, select the desired breakpoint, and click the pencil icon.
2. Define the actions to be performed by IntelliJ IDEA on hitting breakpoint:
* To notify about the reaching of a breakpoint with a text message in the debugging console, check the "Log message to console" check box. A message of the format `*DBG* 'Elixir.IntellijElixir.DebugServer' got cast {breakpoint_reached, PID}` will appear in the console.
* To set a breakpoint the current one depends on, select it from the "Disabled until selected breakpoint hit" drop-down list. Once dependency has been set, the current breakpoint is disabled until selected one is hit.
* Choose the "Disable again" radio button to disable the current breakpoint after selected breakpoint was hit.
* Choose the "Leave enabled" radio button to keep the current breakpoint enabled after selected breakpoint was hit.
* Enable suspending an application upon reaching a breakpoint by checking the "Suspend" check box.

##### Creating Line Breakpoints

A line breakpoint is a breakpoint assigned to a specific line in the source code.

Line breakpoints can be set on executable lines. Comments, declarations and empty lines are not valid locations for the line breakpoints. Line break points can be set in `.ex` and `.eex` files.

![ex](screenshots/debugger/breakpoints/creating/ex.png?raw=true)

`.eex` line breaks will only work on Elixir code that is used in Phoenix view modules.

![eex](screenshots/debugger/breakpoints/creating/eex.png?raw=true)

`.eex` breakpoints only work if a `.beam` file using the template's relative can be found. **This means that the Phoenix view module `.beam` file must exist in `_build` prior to setting a breakpoint. Run the Run Configuration once, before debugging to complete the build if setting a breakpoint does not work.**

1. Place the caret on the desired line of the source code.
2. Do one of the following:
* Click the left gutter area at a line where you want to toggle a breakpoint
* Run > Toggle Line Breakpoint
* `Cmd+F8`

##### Describing Line Breakpoints

1. [Open the Breakpoints dialog](#viewing-all-breakpoints)
2. Right-click the breakpoint you want to describe
3. Select "Edit description" from the context menu
4. In the "Edit Description" dialog box, type the desired description.

##### Searching for Line Breakpoints

1. [Open the Breakpoints dialog](#viewing-all-breakpoints)
2. Start typing the description of the desired breakpoint

##### Jump to Breakpoint Source

* To view the selected breakpoint without closing the dialog box, use the preview pane.
* To open the file with the selected breakpoint for editing, double-click the desired breakpoint.
* To close Breakpoints dialog, press `Cmd+Down`. The caret will be placed at the line marked with the breakpoint in question.

##### Disabling Line Breakpoints

When you temporarily disable or enable a breakpoint, its icon changes from Enabled breakpoint icon to Disabled breakpoint icon and vice versa.

1. Place the caret at the desired line with a breakpoint.
2. Do one of the following:
* Run > Toggle Breakpoint Enable
* Right-click the desired breakpoint icon, select or deselect the enabled check box, and then click Done.
* Alt-click the breakpoint icon

##### Deleting Line Breakpoints

Do one of the following:

* In the [Breakpoints](#viewing-all-breakpoints) dialog box, select the desired line breakpoint, and click the red minus sign.
* In the editor, locate the line with the line breakpoint to be deleted, and click its icon in the left gutter.
* Place caret on the desired line and press `Cmd+F8`.

#### Starting the Debugger Session

1. Select the run/debug configuration to execute
2. Do one of the following
* Click Bug on the toolbar
* Run > Debug
* `Ctrl+D`

OR

Debug quick menu

1. `Ctrl+Alt+D`
2. Select the configuration from the pop-up menu
3. Hit `Enter`

It takes awhile, once the debugged process is started to configure the [debugger in BEAM](http://erlang.org/doc/man/int.html). To ensure that breakpoints are setup before allow the debugged code to run, the debugger blocks until setup is complete.

1. The debugged process will wait for the debugger to attach

![Waiting for debugger to attach.png](screenshots/debugger/starting/Waiting%20for%20debugger%20to%20attach.png?raw=true)
2. Breakpoints will be set
3. The debugger will mark modules to be [interpreted](http://erlang.org/doc/man/int.html#ni-1)
1. The [code paths](http://erlang.org/doc/man/code.html#get_path-0) will be scanned for `.beam` files
* Code paths from the Elixir SDK will be skipped
![Skipped.png](screenshots/debugger/starting/Skipped.png?raw=true)
* `.beam` files will be interpreted unless they match the Module Filter Pattern
![Completed.png](screenshots/debugger/starting/Completed.png?raw=true)
4. The debugger [attaches](http://erlang.org/doc/man/int.html#auto_attach-2) (so it can receive breakpoint events) and allows the debugged process to continue.
![Attached.png](screenshots/debugger/starting/Attached.png?raw=true)

#### Examining Suspended Program

##### Processes

Debugger processes panel



The "Thread" drop-down lists the current processes in the local
node. Only the current process is suspended. The rest of the
processes are still running.

##### Frames

Debugger frames panel



The Frames for the current process can be navigated up and down
using the arrow keys or clicking on the frame.

* Press `Up` or `Down` to change frames
* Click the stack_frame from the list

###### Jump to Current Execution Point

When changing frames or jumping to definitions, you can lose track of where the debugger is paused. To get back to the current execution point, do one of the following:
1. Run > Show Execution Point.
2. `Alt+F10`
3. Click Show Execution Point button on the stepping toolbar of the Debug tool window.

##### Variables

![Binary.png](screenshots/debugger/variables/Binary.png?raw=true)

Binaries show each byte at the byte's offset.

![Bitstring.png](screenshots/debugger/variables/Bitstring.png?raw=true)

Bitstrings show each byte with any partial byte annotated with its bitwidth.

![Boolean.png](screenshots/debugger/variables/Boolean.png?raw=true)

Boolean variables are rendered as their value.

![Charlist.png](screenshots/debugger/variables/Charlist.png?raw=true)

Charlists show the integer values because they're treated as lists

![Functions.png](screenshots/debugger/variables/Functions.png?raw=true)

Functions don't have literal representation, so the inspect form starting with `#Fun<...>` is shown

![Lists.png](screenshots/debugger/variables/Lists.png?raw=true)

Lists render differently based on whether the list is improper or not. Improper lists show the head and tail while proper lists show their element by offset.

![Maps.png](screenshots/debugger/variables/Maps.png?raw=true)

Maps render differently based on the key type. If the map uses all `atom` keys, the key will equal the value in the nested children while non-atom keys are shown as entries at a specific offset with the key and value. This is done, so that complex keys that have subterms can be expanded or collapsed, which is not possible for the simpler atom rendering.

![Numbers.png](screenshots/debugger/variables/Numbers.png?raw=true)

Floats and integers are rendered as literals.

![Pid.png](screenshots/debugger/variables/Pid.png?raw=true)

Pids are broken up into their hidden `node, `id`, and `serial`.

![String.png](screenshots/debugger/variables/String.png?raw=true)

Strings show their literal value and unicode is fully supported.

![Tuple.png](screenshots/debugger/variables/Tuple.png?raw=true)

Tuples show their elements at their offsets.

![Rebound.png](screenshots/debugger/variables/Rebound.png?raw=true)

While Elixir allows rebinding variable names, Erlang does not, so when viewed in the Variables pane, rebound variables will have an `@VERSION` after their name indicating which rebinding of a the variable is.

#### Evaluate

When stopped at a breakpoint, you can use the Evaluate button (it looks like a simple pocket calculator) to open an editor to type code to be executed in the current stack frame.

![Evaluate.png](screenshots/debugger/Evaluate.png?raw=true)

The evaluator supports the full syntax.

![Result.png](screenshots/debugger/evaluate/Result.png)

The result of evaluating the code with be shown as the value of `result` below the entered "Expression".

![Exception.png](screenshots/debugger/evaluate/Exception.png?raw=true)

![Typo.png](screenshots/debugger/evaluate/Typo.png?raw=true)

Errors in the code will report back as a `result` tuple with an `:EXIT` tag. This reflects that the error has crashed the process that was evaluating the code. Thankfully, due to how how the interpreter is written, this does not lose the current stack frame and stepping or other evaluation can continue.

#### Stepping

| Action | Icon | Shortcut | Description |
|----------------------|-------------------------------------------------------------------------|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Show Execution Point | Show Execution Point button