Skip to content

v6.3.0

Compare
Choose a tag to compare
@KronicDeth KronicDeth released this 20 Oct 13:45

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

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.
  • #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 calling erl directly in IntelliJ IDEA added a check that sdk type was the Elixir SDK Type, but there was no else 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 the elixir (or elixir.bat executable and set it in the GeneralCommandLine.
  • #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.

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

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.
  • #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 calling erl directly in IntelliJ IDEA added a check that sdk type was the Elixir SDK Type, but there was no else 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 the elixir (or elixir.bat executable and set it in the GeneralCommandLine.
  • #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.

README updates

Elixir plugin

Build Status

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
  1. Open Directory of the project
  2. 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.

  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
  5. Click Next
  6. The "Mix project root" will be filled in with the selected directory.
  7. (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 and mix deps.get will be run.
  8. 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 the mix file without the extension.
  9. Ensure the "Mix Version" is as expected. The number in parentheses should match the Elixir version.
  10. Click Next
  11. 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.
  12. Check the box next to the project root to use only its mix.exs. (It will likely be the first checkbox at the top.)
  13. Click Next
  14. Select a Project SDK directory by clicking Configure.
  15. 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.
    )
  16. 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.)
  17. 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.

  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
    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
  2. Select Elixir from the project type menu on the left
  3. Click Next
    File > New > Project > Elixir
  4. Select a Project SDK directory by clicking Configure.
    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 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
  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

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

Warning Annotations

Individual check failures will show the explanation (from mix credo PATH:LINE(:COLUMN)) if you hover over the annotation

Explanation

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

Elixir External Tools in 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 External Tools in 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.

  1. Open Preferences > Other Settings > Elixir External Tools
  2. 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