v6.3.0
Thanks
- For explaining difficulties with using README Project section in Small IDEs
- For reporting that the Internal Erlang SDK in Elixir SDK in Rich IDE support in 6.2.0 broke
mix test
runner for Small IDEs- Jan Stevens @JanStevens
Changelog
v6.3.0
Enhancements
- #854 - @KronicDeth
credo
external annotator- Once modifications have settled on a file and all internal annotators have run,
mix credo
will be run on any modified file.- Each check failure reported by
mix credo
will be turned into a warning annotation (yellow highlight) of the line or line and column credo identified. - If you hover over the annotation (either in the source or on right gutter), the
mix credo PATH:LINE(:COLUMN)
explanation will be shown. Links in the tooltip are clickable and allow you to jump to the specific line or line and column of the failure.
- Each check failure reported by
- Once modifications have settled on a file and all internal annotators have run,
- #856 - @KronicDeth
- Explain Rich vs Small IDEs more
- Add feature support table for Rich vs Small IDEs with links to alternatives for Rich IDEs features not in Small IDEs.
- Reorder Project subsections based on usage.
Bug Fixes
- #854 - Rename package with typo
org.elixir_lang.annonator
->org.elixir_lang.annotator
. - @KronicDeth - #855 - @KronicDeth
- Change error to say mix, elixir, or erlang path is not set instead of just mix path.
- Rewrite of
MixRunningStateUtil#setElixir
to support callingerl
directly in IntelliJ IDEA added a check that sdk type was the Elixir SDK Type, but there was noelse
clauses to handle that there IS an SDK, but its NOT Elixir, which is the common case on all Small IDEs (like Rubymine). To fill this gap, if the SDK is not Elixir and a Small IDE is detected, then the SDK Home from Preferences > Other Settings > Elixir External Tools > Elixir SDK > Path will be used to get the absolute path to theelixir
(orelixir.bat
executable and set it in theGeneralCommandLine
.
- #856 - @KronicDeth
- Add missing
**
for bold. - Document alternative setup in Small IDEs
- Put Import from external model first in Project subsections, so that people are more likely to import as a mix project correctly.
- Add missing
README updates
Thanks
- For explaining difficulties with using README Project section in Small IDEs
- For reporting that the Internal Erlang SDK in Elixir SDK in Rich IDE support in 6.2.0 broke
mix test
runner for Small IDEs- Jan Stevens @JanStevens
Changelog
v6.3.0
Enhancements
- #854 - @KronicDeth
credo
external annotator- Once modifications have settled on a file and all internal annotators have run,
mix credo
will be run on any modified file.- Each check failure reported by
mix credo
will be turned into a warning annotation (yellow highlight) of the line or line and column credo identified. - If you hover over the annotation (either in the source or on right gutter), the
mix credo PATH:LINE(:COLUMN)
explanation will be shown. Links in the tooltip are clickable and allow you to jump to the specific line or line and column of the failure.
- Each check failure reported by
- Once modifications have settled on a file and all internal annotators have run,
- #856 - @KronicDeth
- Explain Rich vs Small IDEs more
- Add feature support table for Rich vs Small IDEs with links to alternatives for Rich IDEs features not in Small IDEs.
- Reorder Project subsections based on usage.
Bug Fixes
- #854 - Rename package with typo
org.elixir_lang.annonator
->org.elixir_lang.annotator
. - @KronicDeth - #855 - @KronicDeth
- Change error to say mix, elixir, or erlang path is not set instead of just mix path.
- Rewrite of
MixRunningStateUtil#setElixir
to support callingerl
directly in IntelliJ IDEA added a check that sdk type was the Elixir SDK Type, but there was noelse
clauses to handle that there IS an SDK, but its NOT Elixir, which is the common case on all Small IDEs (like Rubymine). To fill this gap, if the SDK is not Elixir and a Small IDE is detected, then the SDK Home from Preferences > Other Settings > Elixir External Tools > Elixir SDK > Path will be used to get the absolute path to theelixir
(orelixir.bat
executable and set it in theGeneralCommandLine
.
- #856 - @KronicDeth
- Add missing
**
for bold. - Document alternative setup in Small IDEs
- Put Import from external model first in Project subsections, so that people are more likely to import as a mix project correctly.
- Add missing
README updates
Elixir plugin
This is a plugin that adds support for Elixir 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 who does not get any of the subscription money. If you want to support the plugin itself, make a donation.
IDE | Rich/Small | Languages | Cost | Trial | License | Source |
---|---|---|---|---|---|---|
IntelliJ IDEA Community Edition | Rich | Java | Free | N/A | Apache 2.0 | JetBrains/intellij-community |
IntelliJ IDEA Ultimate Edition | Rich | Java | Subscription | 30-days | Commercial | N/A |
AppCode | Small | Objective-C | Subscription | 30-days | Commercial | N/A |
CLion | Small | C/C++ | Subscription | 30-days | Commercial | N/A |
DataGrip | Small | SQL | Subscription | 30-days | Commercial | N/A |
Gogland | Small | Go | Free | N/A | Early Access Preview | N/A |
PHPStorm | Small | PHP | Subscription | 30-days | Commercial | N/A |
PyCharm Community Edition | Small | Python | Free | N/A | Apache 2.0 | JetBrains/intellij-community subdirectory |
PyCharm Professional Edition | Small | Python | Subscription | N/A | Commercial | N/A |
Rider | Small | .NET | Subcription | N/A | Commercial | N/A |
RubyMine | Small | Ruby | Subscription | 30-days (90-day for whole team) | Commercial | N/A |
WebStorm | Small | JavaScript | Subscription | 30-days | Commercial | N/A |
Once you have your IDE of choice installed, you can install this plugin
Features
Feature | Rich | Small | Alternative |
---|---|---|---|
Project | Yes | No | 1. Open directory 2. Elixir SDK Path in External Elixir Tools |
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 | |
Building/Compiling | Yes | No | Build/compile as part mix run configurations only |
Live Templates | Yes | Yes | |
Run Configurations | Yes | Yes | |
Completion | Yes | Yes | |
Decompilation | Yes | Yes | |
Go To Declaration | Yes | Yes | |
Formatting | Yes | Yes | |
Go To Symbol | Yes | Yes | |
Go To Test | Yes | Yes | |
Go To Test Subject | Yes | Yes | |
Find Usage | Yes | Yes | |
Refactor | Yes | Yes | |
SDK | Yes | No | Elixir SDK Path in External Elixir Tools |
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- Open Directory of the project
- Setup the Elixir SDK Path in External Elixir Tools
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.
- File > New > Project From Existing Sources...
- Select the root directory of your project.
- Select "Import project from external model"
- Select Mix
- Click Next
- The "Mix project root" will be filled in with the selected directory.
- (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 hex.local --force
andmix deps.get
will be run.
- If "Fetch dependencies with mix" is checked both
- Ensure the correct "Mix Path" is detected. On Windows, the
mix.bat
, such as
C:\Program Files (x86)\Elixir\bin\mix.bat
should be used instead of themix
file without the extension. - Ensure the "Mix Version" is as expected. The number in parentheses should match the Elixir version.
- Click Next
- 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. - Check the box next to the project root to use only its
mix.exs
. (It will likely be the first checkbox at the top.) - Click Next
- Select a Project SDK directory by clicking Configure.
- 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
with information about Elixir install locations on your operating system and package manager to have SDK detection
added for it.) - If the automatic detection doesn't find your Elixir SDK or you want to use an older version, manually select select
the directory above thebin
directory containingelixir
,elixirc
,iex
, andmix
. (On Windows it is the
directory containingelixir.bat
,elixirc.bat
,iex.bat
, andmix.bat
.) - Click Finish after you select SDK name from the Project SDK list.
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.
- File > New > Project From Existing Sources...
- Select the root directory of your project.
- Leave the default selection, "Create project from existing sources"
- Click Next
- Project name will be filled with the basename of the root directory. Customize it if you like.
- Project location will be the root directory.
- Click Next.
- If you previously opened the directory in IntelliJ or another JetBrains IDE, you'll be prompted to overwrite the
.idea directory. Click Yes. - 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. - Click Next.
- Select a Project SDK directory by clicking Configure.
- 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
with information about Elixir install locations on your operating system and package manager to have SDK detection
added for it.) - If the automatic detection doesn't find your Elixir SDK or you want to use an older version, manually select select
the directory above thebin
directory containingelixir
,elixirc
,iex
, andmix
. - Click Next after you select SDK name from the Project SDK list.
- Click Finish on the framework page. (No framework detection is implemented yet for Elixir.)
- 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.
- File > New > Project
- Select Elixir from the project type menu on the left
- Click Next
- Select a Project SDK directory by clicking Configure.
- Select a Project SDK directory by clicking Configure.
- The plugin will automatically find the newest version of Elixir installed.
- macOS / OSX
- Homebrew (
/usr/local/Cellar/elixir
) - Nix (
/nix/store
)
- Homebrew (
- 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 with information about Elixir install locations on your operating system and package manager to have SDK detection added for it.)
- 32-bit (
- macOS / OSX
- 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 containingelixir
,elixirc
,iex
, andmix
. If thebin
,lib,
orsrc
directory is incorrectly selected, it will be corrected to the parent directory. - Click Next after you select SDK name from the Project SDK list.
- Change the
Project name
to the name your want for the project
- (Optionally) change the
Project location
if the directory does not match what you want - (Optionally) expand
More Settings
to change theModule name
,Content root
,Module file location
, and/orProject format
. The defaults derived from theProject name
andProject location
should work for most projects. - Click Finish
- Choose whether to open in a New Window or in This Window.
External Annotators
In addition to the built-in syntax highlighting and annotations above, various mix
tasks will be run to gather annotations from Elixir status analysis tools.
Credo
If credo
is not installed as a project dependency, nothing will happen, but if it is installed, mix credo PATH
will be called on any files after updates have quieted. Any credo
check failures will show up as warning annotations
Individual check failures will show the explanation (from mix credo PATH:LINE(:COLUMN)
) if you hover over the annotation
You can hover over the explanation and click the embedded links to jump to the line (and column) where the failure occurred.
SDK
NOTE: These instructions only apply to Rich IDEs, for a Small IDE use Elixir SDK Path
Elixir External Tools
Rich IDEs
In a Rich IDE, like IntelliJ IDEA, only the path to mix
is configured as an external tool. This mix
path is only used when creating new projects, so when opening a pre-existing project with Import project from external model, this doesn't even need to be set.
Small IDEs
Elixir SDK Path
NOTE: To setup the SDK in a Rich IDE use Import project from external model or SDK
In a Small IDE, like Rubymine, the Project SDK is always a Ruby SDK, so to support a pseudo-Elixir-SDK in a Small IDE, the Elixir SDK Path can be set.
- Open Preferences > Other Settings > Elixir External Tools
- Set the Elixir SDK Path
- Paste the path to an Elixir SDK
- Click the
...
to select the directory
The pattern for the Elixir SDK Path varies based on the OS and package manager you used to install Elixir
OS | Package Manager | Elixir SDK Path |
---|---|---|
OSX/macOS | Homebrew | /usr/local/Cellar/elixir/VERSION |
OSX/macOS/Linux | Nix | /nix/store/HASH-elixir-VERSION |
Windows 32-bit | Erlang Solutions | C:\Program Files\Elixir |
Windows 64-bit | Erlang Solutions | C:\Program Files (x86)\Elixir |
Linux | Default | /usr/local/lib/elixir |