KronicDeth
IntelliJ Elixir - Elixir plugin for JetBrain's IntelliJ Platform
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine)
This is a plugin that adds support for Elixir to JetBrains IntelliJ IDEA platform IDEs (DataGrip, AppCode, IntelliJ IDEA, PHPStorm, PyCharm, Rubymine, WebStorm).
It works with the free, open source Community edition of IntelliJ IDEA in addition to the paid JetBrains IDEs like Ultimate edition of IntelliJ. No feature is locked to a the paid version of the IDEs, but the plugin works best in IntelliJ because only IntelliJ supports projects with different languages than the default (Java for IntelliJ, Ruby for Rubymine, etc).
The plugin itself is free. Once you have your IDE of choice installed, you can install this plugin.
Most Liked
KronicDeth
v4.5.0 was a canary release, so it’s release notes are included in this general release in case you didn’t run the canary
Thanks
- Thanks to Matt Briggs (@mbriggs) and Andrei Dziahel (@develop7) for reporting the
NullPointerExceptionfromorg.elixir_lang.psi.scope.call_definition_clause.Variants.getLookupElementCollection. - Thanks to Sergey Zubtsovskiy (@szubtsovskiy) for reporting
StackOverflowErrors from certain forms ofwithand helping me narrow down specific minimal reproduction cases. - Thanks to @mdhirsch for finding a parser bug (!) after all this time: newlines weren’t allowed before
dofordoblocks. - Thanks to Scott Bennett (sbennett33) for finding a case that triggered the
ElixirNoParenthesesStricterror handling, which revealed thatisVariabledidn’t handle it correctly. - Thanks to Andrei Dziahel (@develop7) for reporting an error that while I couldn’t reproduce did lead to an improved error reporter, so I can figure it out if it happens again.
- Thanks to Danni Friedland (BlueHotDog) for reporting a bug that led me to find that
Prefix.primaryArgumentswasn’t usingNormalizedand still was using basicasserts. - Thanks to Aaron Foster (AnimalRepellentGranules) for reporting that the
doendmatching was too aggressive and incorrectly matched on one liners starting at thedo:.
Changelog
v4.6.0
Enhancements
- #454 - Regression test for #453 - @KronicDeth
- #455 - Regression test for #446 - @KronicDeth
- #464 - Show element class in all error reports - @KronicDeth
- #465 - Regression test for #456 - @KronicDeth
- #466 - Regression test for #458 - @KronicDeth
- #467 - Regression tests for #443 - @KronicDeth
- #474 - Regression test for #462 - @KronicDeth
- #476 - Regression test for #468 - @KronicDeth
- #477 - @KronicDeth
- Regression test for #469
- Highlight Strings and String Heredocs as errors in types.
- #479 - Regression tests for #470 - @KronicDeth
- #483 - @KronicDeth
- Add
Qualified#qualifierby extracting it fromCallDefinitionClauseCompletionProvider. - Add
Modularclass with#forEachCallDefinitionClauseNameIdentifierto enumerate all the identifiers that could be linked to in a modular. - Add
ElixirPsiImplUtil#maybeQualifiedCallToModularby extractingresolveFullyfromCallDefinitionClauseCompletionProvider - Add regression tests for #463.
- Add
- #484 - Regression test for #471 - @KronicDeth
- #485 - Regression test for #472 - @KronicDeth
- #486 - @KronicDeth
- Extract
Arrowinterface for*ArrowOperations. - Regression tests for #480
- Extract
Bug Fixes
- #454 - Return
emptySetwhenlookupElementByPsiElementisnull. - @KronicDeth - #455 - @KronicDeth
-
Don’t do a naked
assertthat there are 2 children because this can fail during error recovery on the operand, instead use theprefix.Normalized.operand()throughprefix.operand().WARNING: This changes the
@NotNullarray so that its sole element changes from@NotNullto@Nullable. It may trigger new bugs.
-
- #461 - Use shipped
GeneratedParserUtilBase.DUMMY_BLOCKbecause theDUMMY_BLOCKMUST match theGeneratedParserUtilBaseto detect dummy blocks inserted for error handling. - @KronicDeth - #465 - Skip over
ElixirNoParenthesesStrictforisVariable- @KronicDeth - #466 - Allow newlines before
doindoBlock- @KronicDeth - #467 - Don’t match
doorfntoendwhen used as a keyword key. - @KronicDeth - #474 - @KronicDeth
- Check if
iterator.atEnd()before callingiterator.getTokenType()to avoidIndexOutOfBoundsexception. - Don’t add current call definition clause being written to completion
- Check if
- #476 -
When#leftOperandwill returnnull(because it’s normalized) if there are left-hand error elements, but when stripping guards we want best-effort to match human expectations, so don’t use normalizednull, but use left, non-error element if it is unique. - @KronicDeth - #477 - Highlight types in
QualifiedNoParenthesesCall- @KronicDeth - #478 - Still not obvious why
namefor aCallDefinitionClauselookup renderer can be longer thanpresentableText, so still log an error, but withLogger.error, so we getname,presentableText, and the originalelement. - @KronicDeth - #479 - @KronicDeth
- Skip
Argumentselements inpreviousParentExpresionto eliminate an unnecessary level of processing declarations since calls will enter their arguments. - Only put new
ENTRANCEinResolveStateinvariable.MultiResolve.resolveResultList, so that caller can override the default value. - Set
ENTRANCEtomatchAncestorinstead of previous expression to eliminate the looping that occurred when a variable was unbound (or a function) because the check forwith(andfor) was expecting theENTRANCEto be the previous child expression instead of thewithclause as a whole (or theArgumentselement as had been the case before 6fcc19b).
- Skip
- #483 - @KronicDeth
- Resolves functions qualified by Aliases that are either direct Module references or one-step aliases.
- Remove
Call#resolvedFunctionNamebecauseimportcan’t rename functions.
- #484 - Don’t type-highlight
BracketOperations as they occur when putting maps or structs in front of lists. - @KronicDeth - #485 - Treat
Enum.eachthe same asEnum.maparounddef- @KronicDeth - #486 - Increase
resolvedFinalArityby1for piping. - @KronicDeth - #498 - @KronicDeth
- Go To Declaration resolves through
import- for
import MyModule- the
importstatement - the call definition clause in the imported Module.
- the
- for
import MyModule, only: [name: arity]- the
importstatement - the call definition clause in the imported Module.
- the
- for
import MyModule, except: [name: arity]if reference is notname/arity.- the
importstatement - the call definition clause in the imported Module.
- the
- for
- Go To Declaration resolves through
v4.5.0
Enhancements
- #452 - @KronicDeth
- Go To Declaration for functions and macros (only those defined in parseable-Elixir source. References to Erlang functions or only those available in
.beamfile, such as the standard library will not resolve.) - Completion for functions and macros (only those defined in parseable-Elixir source. Erlang functions and Elixir function only in compiled
.beamfile, such as the standard library will not complete.)- Completion uses the same presentation as Structure View, so the you can tell whether the name is a function/macro, whether it is public/private, and the Module where it is defined.
- Completed functions/macro insert
()after the name in preparation for Elixir 1.4 where it is an error to have bare function calls. It also makes it more obvious that you inserted a function and not a variable. - Completion works for all functions when a bare identifier is used. For a qualified identifier, only functions/macros under than Module are shown.
- Go To Declaration for functions and macros (only those defined in parseable-Elixir source. References to Erlang functions or only those available in
README Changes
Completion
Function and Macro Calls
Completion uses the same presentation as Structure, so you can tell whether the name is function/macro (Time), whether it is public/private (Visibility) and the Module where it is defined. Between the icons and the Modules is the name itself, which is highlighted in bold, the parameters for the call definition follow, so that you can preview the patterns required for the different clauses.
Qualified
Qualified functions and macro calls will complete using those functions and macros defined in the qualifying Module (defmodule), Implementation (defimpl) or Protocol (defprotocol). Completion starts as shown as . is typed after a qualifying Alias.
Unqualified
Function and macro calls that are unqualified are completed from the index of all function and macro definitions, both public and private. (The index contains only those Elixir functions and macro defined in parsable source, such as those in the project or its dependencies. Erlang functions and Elixir functions only in compiled .beam files, such as the standard library will not complete.) Private function and macros are shown, so you can choose them and then make the chosen function or macro public if it is a remote call.
Go To Declaration
Function or Macro
You’ll know if function or macro usage is resolved and Go To Declaration will work if the call is annotated, which in the default themes will show up as italics.
Imported Functions or Macros
- Place the cursor over name of the function or macro call.
- Activate the Go to Declaration action with one of the following:
Cmd+B- Select Navigate > Declaration from the menu.
Cmd+Click
- A Go To Declaration lookup menu will appear, allowing you to jump to either the
importthat imported the function or macro or jumping directly to the function or macro definition clause. Select which declaration you want.- Use arrow keys to select and hit
Enter Click
- Use arrow keys to select and hit
Local Functions or Macros
- Place the cursor over name of the function or macro call.
- Activate the Go to Declaration action with one of the following:
Cmd+B- Select Navigate > Declaration from the menu.
Cmd+Click
- Whether a lookup a Go To Declaration lookup menu appears depends on the number of clauses in the function or macro definition:
- If there is only one clause in the function or macro definition, you’ll jump immediately to that clause
- If there is more than one clause in the function or macro definition, a Go To Declaration lookup menu will appear, allowing you to jump to either the
importthat imported the function or macro or jumping directly to the function or macro definition clause. Select which declaration you want.- Use arrow keys to select and hit
Enter Click
- Use arrow keys to select and hit
Remote Functions or Macros
- Place the cursor over name of the function or macro call that is qualified by an Alias.
- Activate the Go to Declaration action with one of the following:
Cmd+B- Select Navigate > Declaration from the menu.
Cmd+Click
-
- If there is only one clause in the function or macro definition, you’ll jump immediately to that clause
- If there is more than one clause in the function or macro definition, a Go To Declaration lookup menu will appear, allowing you to jump to either the
importthat imported the function or macro or jumping directly to the function or macro definition clause. Select which declaration you want.- Use arrow keys to select and hit
Enter Click
- Use arrow keys to select and hit
Installation
Inside IDE using JetBrains repository
- Preferences
- Plugins
- Browse Repositories
- Select Elixir
- Install plugin
- Apply
- Restart the IDE
Inside IDE using Github releases
In browser
- Go to releases.
- Download the lastest zip.
In IDE
- Preferences
- Plugins
- Install plugin from disk…
- Select the downloaded zip.
- Apply
- Restart the IDE.
KronicDeth
Thanks
- Thanks to Jake Becker (@JakeBecker) for adding Mix ExUnit Run Configurations and create from context.
- Thanks to @andyl for requesting Navigate > Test and Navigate > Test Subject as it was a good complement to Jake Becker’s new Mix ExUnit Run Configurations
- Thanks to Alexander Merkulov (@merqlove) for outline the testing workflow that Jack Becker ended up implementing
- Thanks to @davit55 and Matt Briggs (@mbriggs) for confirming that lookup name could exceed the element text and it wasn’t just an artifact of my development environment
- Thanks to @taorg for a full test case to show how MultipleAliases would need to be supported in
isVariable - Thanks to Josh Taylor (@joshuataylor for posting a screenshot of the bad lookup formatting for variables.
- Thanks to Matt Briggs (@mbriggs) for posting an error about the error reporter

- Thanks to Josh Taylor (@joshuataylor, Matt Briggs (@mbriggs), Cris (@crisonyx), @sngyai, @lucdang, Cris (@crisonyx), Sven Marquardt (@Eiamnacken), and Aaron Eikenberry (@aeikenberry) for reporting that
CallDefinitionClause(Call)needed between error handling to avoid aNullPointerException - Thanks to Matt Briggs (@mbriggs) for posting the source for a reproduction-case for the StackOverflow that was plaguing @andshape, Robert Hencke (@rhencke), Alexander Merkulov (@merqlove), @fieldinrain, Roman (@roman462), Andrei Dziahel (@develop7), and Josué Henrique Ferreira da Silva (@josuehenrique)
- Thanks to Tiziano Puppi (@tizpuppi) for demonstrating how a typing a typo could cause an error in variable use scope.
- Thanks to nsm (@nsmuffin) for posting that working directory being null wasn’t treated the same as not being a directory.
- Thanks to Ryan Scheel (@Havvy for showing how missing a
:in type specs could break the highlighting, which led to the inspections and quick fixes in this release.
Changelog
v4.7.0
Enhancements
- #523 - Use the
CommonProgramParametersPanelto get the working directory and environment variables the same way the JUnit form does. Replace the custom “Command” input with the “Program arguments” input built into theCommonProgramParametersPanel.CommonProgramParametersPanelexpects to store the “Program Arguments” in a “ProgramParameters” field, so old run configurations will lose their “Command” option value and it will be migrated to the new “ProgramParameters”. - @KronicDeth - #482 - @JakeBecker, @KronicDeth
- Create / Run Mix ExUnit Run Configurations
- Run Configuration from Directory
- Run Configuration from File
- Run Configuration from LIne
- Run Configurations support Common Program Parameters
- Program Arguments
- Working directory
- Environment variables
- Create / Run Mix ExUnit Run Configurations
- #531 - @KronicDeth
enclosingMacroCallreturns enclosing macro call when parent isElixirDoBlock, so thatendelement goes to the macro call.Navigate > Testwill go to the Module that has the same canonical name as the currentdefimpl,defmodule,defprotocol, orquotewith aTestsuffix addedNavigate > Test Subjectwill go to thedefimpl,defmodule,defprotocol, orquotethat has the same canonical name as the current Module with theTestsuffix removed.
- #533 - Regression test for #500 - @KronicDeth
- #545 - Regression test for #517 - @KronicDeth
- #548 - Regression test for #521 - @KronicDeth
- #549 - @KronicDeth
- Regression test for #525
- If
:is used instead of::for a type specification, mark it as an error with a Quick Fix to convert:to::. - Highlight
=operands the same as::operands in type specifications. - If
=is used instead of::in a type specification, mark it as an error with a Quick Fix to convert=to::.
Bug Fixes
- #523 - Fix typo:
myRunInModuleChekcBox=>myRunInModuleCheckBox- @KronicDeth - #532 - Don’t log error when name length exceeds presentable text length because it appears to be common for normal users and not a development environment artifact. - @KronicDeth
- #533 - Check parent of
ElixirMultipleAliasesforisVariablebecauseElixirMultipleAliasescan be hit inisVariablewhenMyAlias.is added on a line above a pre-existing tuple, such as when typing a new qualified call. - @KronicDeth - #534 - Add space between variable and match in lookup element presentation - @KronicDeth
- #535 - Check
VirtualFileis not null before creating attachment becausePsiFilecan lack aVirtualFileif thePsiFileonly exists in memory. - @KronicDeth - #537 - Convert
CallDefinitionClause(Call)toCallDefinitionClause.fromCall(Call), so thatnullcan be returned whenCallDefinitionClause.enclosingModular(Call)returnsnull. - @KronicDeth - #539 - @KronicDeth
- Use
functionNameinstead ofgetNamewhen multiresolving unqualified functions becausegetNamewill return the Alias when called ondefmodule. maybeQualifiedCallToModularreturnednullBOTH (1) if the call was unqualified OR (2) if the call was qualified, but its modular could not be resolved, so qualified calls to.beam-only modules, likeFile.read!returnednullbecauseFilecould not be resolved to a modular. RemovemaybeqQualifiedToModularand callqualifiedToModularwhenmyElementis qualified. If the modular isnull, then return an emptyResolveResult[]instead of looking for unqualified matches.- Pass
maxScopetoModulereference.maxScopeis generally the containing file for the element, but when usingModuleto resolveimports, it is theimportcall’s parent element, so that the resolve doesn’t ricochet between thedefmoduleand its child, theimportcall untilStackOverflowError.
- Use
- #545 - A variable cannot be declared in update arguments, so return
LocalSearchScope.EMPTY, the same as interpolation. - @KronicDeth - #548 -
ElixirSystemUtil.getProcessOutputalready allowed for an empty, invalidProcessOutputwhen theworkDirwasn’t a directory, so allow it to also benulland return the emptyProcessOutput. - @KronicDeth - #549 - @KronicDeth
- If a single keyword pair is used for a type spec, treat
:as a type for:: - Limit variable use scope for variables “declared” in module attributes to the module attribute because the variable can’t be declared there and it is really a variable usage without declaration.
- If a single keyword pair is used for a type spec, treat
README Changes
Inspections
Keyword pair colon (:) used in type spec instead of type operator (::)
Type specifications separate the name from the definition using ::.
@type name: definition
Replace the : with ::
@type name :: definition
Match operator (=) used in type spec instead of type operator (::)
Type specifications separate the name from the definition using ::.
@type name = definition
Replace the = with ::
@type name :: definition
Quick Fixes
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.
Run Configurations
mix test
The mix test task gets a special type of Run Configuration, Elixir Mix ExUnit. Using this Run Configuration type instead, of the basic Elixir Mix Run Configuration will cause the IDE to attach a special formatter to mix test, so that you get the standard graphical tree of Test Results
Creating mix test Run Configurations Manually
- Run > Edit Configurations…
- Click +
- Select “Elixir Mix ExUnit”
- Fill in the “Program arguments” with the argument(s) to pass to
mix test. Normally, this will be a directory liketest, relative to the “Working directory” - Fill in the “Working directory”
- Type the absolute path to the directory.
- Select the path using directory picker by clicking the
...button
- (Optionally) click the
...button on the “Environment variables” line to add environment variables. - Click “OK” to save the Run Configuration and close the dialog
- Click the RUn arrow in the Toolbar to run the
mix testtask - The Run pane will open showing the Test Results
While you can create Elixir Mix ExUnit run configurations manually using the Run > Edit Configurations... menu, it is probably more convenient to use the context menu.
Creating mix test Run Configurations from context
The context menu must know that the the directory, file, or line you are right-clicking is a test. It does this by checking if the current directory or an ancestor is marked as a Test Sources Root.
- In the Project pane, ensure your OTP application’s
testdirectory is marked as a Test Sources Root - Check if the
testdirectory is green. If it is, it is likely a Test Sources Root. This color may differ in different themes, so to be sure you can check the context menu - Right-click the
testdirectory. - Hover over “Mark Directory As >”
* If “Unmark as Test Sources Root” is shown, then the directory is already configured correctly, and create from context will work.
* If “Test Sources Root” is shown, then the directory need to be configured by clicking that entry
Creating/Running mix test Run Configurations from directory
- Right-click the directory in the Project pane
- Click “Run Mix ExUnit”, which will both create the Run Configuration and Run it.
- If you want to only create the Run Configuration, select “Create Mix ExUnit” instead
Alternatively, you can use keyboard shortcuts
- Select the directory in the Project pane.
Ctrl+Shift+Rwill create the Run Configuration and Run it.
Creating/Running mix test Run Configurations from file
- Right-click the file in the Project pane
- Click “Run Mix ExUnit”, which will both create the Run Configuration and Run it.
- If you want to only create the Run Configuration, select “Create Mix ExUnit” instead
Alternatively, you can use keyboard shortcuts
- Select the directory in the Project pane.
Ctrl+Shift+Rwill create the Run Configuration and Run it.
Finally, you can use the editor tabs
- Right-click the editor tab for the test file you want to run
- Click “Run Mix ExUnit”, which will both create the Run Configuration and Run it.
- If you want to only create the Run Configuration, select “Create Mix ExUnit” instead
Creating/Running mix test Run Configurations from line
If you want to be able to run a single test, you can create a Run Configuration for a line in that test
- Right-click a line in the test file
- Click “Run Mix ExUnit”, which will both create the Run Configuration and Run it.
- If you want to only create the Run Configuration, select “Create Mix ExUnit” instead
Alternatively, you can use keyboard shortcuts
- Place the cursor on the line you want to test
Ctrl+Shift+Rwill create the Run Configuration and Run it.
Installation
Inside IDE using JetBrains repository
- Preferences
- Plugins
- Browse Repositories
- Select Elixir
- Install plugin
- Apply
- Restart the IDE
Inside IDE using Github releases
In browser
- Go to releases.
- Download the lastest zip.
In IDE
- Preferences
- Plugins
- Install plugin from disk…
- Select the downloaded zip.
- Apply
- Restart the IDE.
KronicDeth
With both the contribution of ExUnit Mix Tasks in 4.7.0 and the conversion of the build to Gradle for 5.0.0, I’ve added Jake Becker (@JakeBecker) as a Collaborator to the repo.
Thanks
- Reporting the
AssertionErrorinorg.elixir_lang.code_insight.lookup.element_renderer.CallDefinitionClause.renderElement- @bdarla
- Josué Henrique Ferreira da Silva (@josuehenrique)
- Arjan Molenaar (@amolenaar)
- Chris Desch (@ cdesch)
- Steve (@stevepm)
- Laura Stone (@tyrostone)
- @wee911
- Oleg Samorai (@Samorai)
- Jadenn (@dabaer)
- Jan Stevens (@JanStevens)
- Szymon Jeż (@szymon-jez)
- Reporting examples where
ElixirVariablecould not be determined if it was a variable.- Steve Wagner (@ciroque)
- Marcin Jakubowski (@mjakubowski84)
- Ryan Cammer (@ryancammer)
- Josué Henrique Ferreira da Silva (@josuehenrique) (multiple examples!)
- Matt Briggs (@mbriggs)
- Reporting examples where
ElixirMultipleAliasescould not resolve variable in match.- Дмитрий Дубина (@dmitrydprog
- Nitin Gupta (@nitingupta910) for
- Reporting examples of the annotator highlighting in the wrong file due to the call definition offset always being assumed to be in the same file.
- Wojciech Bednarski (@wbednarski)
- Artem Gordinsky (@ArtemGordinsky)
- Sam Brotherton (@sbrother)
- Alexander Merkulov (@merqlove)
- Reporting Parameter variable style being incorrectly applied
- Matt Briggs (@mbriggs)
- Working with me to figure out that the template tags in the color preview were messed up
- Dmitry Maltsev (@judgedim)
- Reporting mismatch between inspection resource and class due to a copy-and-paste error
- Markus Fischer (@mfn)
- Reporting incorrect highlighting of functions with guards
- Dmitry Maltsev (@judgedim)
- Requesting configurable code-folding for module attributes
- Artem Rizhov (@artemrizhov)
- Pointing out it makes no sense for context menus for ExUnit to appear in non-Elixir projects
- Alexander Merkulov (@merqlove)
- Reporting an example where
MatchedUnqualifiedParenthesesCallcould not be type highlighted- Ryan Scheel (@Havvy)
- Reporting that function complete didn’t take into account the already typed prefix
- Saeed Zarinfam (@zarinfam)
- Requesting completion of Aliases to
.beam-only Module, which is what inspired me to attempt decompilation- Matt Briggs (@mbriggs)
Changelog
v5.0.0
Enhancements
- #574 - @KronicDeth
- Decompile
.beamfiles- Structure view for decompiled
.beamfiles - Index modules, functions, and macros exported by
.beamfiles - Go To Symbol for Modules defined in
.beamfiles (both SDK and deps)- Erlang using atoms (like
:idna) - Elixir using Alias (like
Enum)
- Erlang using atoms (like
- Completion for Modules defined in
.beamfiles (both SDK and deps)- Elixir using Alias (like
Enum)
- Elixir using Alias (like
- Completion for functions and macros exported by
.beamfiles - Syntax highlighting
- Structure view for decompiled
- Decompile
- #579 - Regression test for #575 - @KronicDeth
- #583 - @KronicDeth
- Macros appear before functions in decompiled
.beamfiles- Header for macro and function sections
- Macros appear before functions in decompiled
- #585 - @KronicDeth
- Update
ELIXIR_VERSIONfor1.2.*from1.2.3to1.2.6 - Add
ELIXIR_VERSION1.3.4 - Add
ELIXIR_VERSION1.4.0 - Update
IDEAfor2016.*to2016.3.1 - Show
OtpErlangBitStr(and thereforeOtpErlangBinarycontents when tests fail - Quote binaries as
to_charlistinstead ofto_char_listfor Elixir>= 1.3. Depends on Elixir version of project SDK. - Use
elixirinstead ofjavaVM, so now Erlang and Elixir don’t need to be built on travis-ci, butantand thejdkneed to be installed, but unlike Erlang and Elixir, there are tarballs for that, so this way is faster than the old method without depending on travis-ci cache.
- Update
- #609 - @KronicDeth
- If
multiResolvecauses aStackOverflowfororg.elixir_lang.annotator.Callable.visitCall, thencatchit and useerrorreportlogger to log the element. - Include file path in
errorreportexcerpt - Log element for
StackOverflowrelated toimports - Regression test for #605.
- Log
LookupElement#getObjectwhenLookupElement#getPsiElementisnullto track down how it wasnullin #563.
- If
- #614 - Regression test for #559 - @KronicDeth
- #504 - @JakeBecker
- Switch to Gradle for builds.
./gradlew runIde(or therunIde (VERSION)Run Configurations) will run IDEA in a sandbox with the development version of the plugin../gradlew test(or thetest (VERSION)Run Configurations) will run the main plugin and jps-builder tests.- The plugin can now be published with
./gradlew publishPlugin, BUT you’ll need to fill inpublish*properties ingradle.properties. This will eventually allow for automated “nightlies” from successful Travis-CI builds onmaster.
- Switch to Gradle for builds.
- #638 - The
Callableannotator is meant for variables, parameters, and macro and function calls and declarations. TheModuleAttributeannotator handles module attribute declaration and usage, so we can save reference resolution time by skipping module attributes inCallable. - @KronicDeth - #640 - Allow module attribute folding to be configured. - @KronicDeth
- #662 - @KronicDeth
- Allow call definition heads to resolves to themselves for consistency with Aliases of
defmodule. - Generalize
Callable.callDefinitionClauseDefiner(Call): in addition to the currentCallDefinitionClause, make it work forImplementation,Module, andProtocol.
- Allow call definition heads to resolves to themselves for consistency with Aliases of
Bug Fixes
- #574 - Fix copy-paste errors in
MatchOperatorInsteadOfTypeOperator- @KronicDeth - #579 - @KronicDeth
- Subtract 1 from arity in
.beamfile when decompiling todefmacrocalls because the Erlang function for Elixir macros has one addition argument: the first argument is theCallerof the macro. - If the name of the decompiled macro/function is an infix operator, then decompile the head as a binary operation instead of a normal prefix name as infix operators aren’t valid prefix names and led to parsing errors, which was the root cause of #575.
- Fix IntelliJ warnings in
BeamFileImpl - Remove unused
VirtualFileargument toBeamFileImpl#buildFileStub.
- Subtract 1 from arity in
- #583 - @KronicDeth
- Add
++,=~, andintoINFIX_OPERATOR_SET. - Only render infix operators if arity is
2. - Prefix operator decompilation:
+and-are both binary and unary operators. When a unary operator they need to be wrapped in parentheses, so that the call definition clause is parsed correctly.
- Add
- #585 - @KronicDeth
- Ignore
JFLexjar - Don’t check for
elixir-lang/elixrfiles remove in1.3 - Allow
nilas a keyword key.nilwas being lexed as a potential keyword key, but NIL was missing from the token list in the keywordKey grammar rule.
- Ignore
- #599 - Some SpecialForms don’t work as literals as they would be interpreted as metaprogramming, so their name needs to be wrapped as an atom to
unquote. - @KronicDeth - #600 - @KronicDeth
- Check children of
MultipleAliasesfor variable declarations. - Treat any variable declared in a
MultipleAliasesas invalid.
- Check children of
- #609 - @KronicDeth
- Skip
import Kernelinkernel.exto prevent stack overflow due to recursiveimport - Strip all outer parentheses for left type operand, so that
(+value)can be see as+operator type spec. - Use advice from
IndexNotReadyExceptiondocumentation and checkDumbService.isDumb(Project)before callingStubIndex.getElementsinModuleandmodule.MultiResolve.indexNameElements. - Don’t
assertthatLookupElement#getPsiElementis notnullinCallDefinitionCluase.renderElement - Update to
ant1.10.1because1.10.0is no longer hosted.
- Skip
- #612 - Yeah, it sounds weird, but an
ElixirVariableisn’t necessarily a variable if it doesn’t occur in a declaration context. It could just be a no-parentheses function call in the wrong spot, so check the parentPsiElementto determine ifElixirVariableis a variable. - @KronicDeth - #614 - Highlight parameterized type head (
maybe(t)in@type maybe(t)) the same as a full type definition (maybe(t)in@type maybe(t) :: t | nil) - @KronicDeth - #616 - Only show Mix ExUnit Run in context when the module, or when the module is not a available, the project SDK is Elixir. If there is no SDK configured, show “Mix ExUnit Run” in the menu. - @KronicDeth
- #617 - Mark
do:as atom in demo text - @KronicDeth - #627 - Annotations can only be applied to the single, active file, which belongs to the
referrerCallable. Theresolvedmay be outside the file if it is a cross-file function or macro usage, in which case it’sTextRangeshould not be highlighted because it is referring to offsets in a different file. - @KronicDeth - #634 - @KronicDeth
Variablescope forQualifiedMultipleAliases, which occurs when qualified call occurs over a line with assignment to a tuple, such asQualifier.\n{:ok, value} = call()- Remove call definition clauses (function or macro) completion for bare words as it had a detrimental impact on typing feedback (the editor still took input, but it wasn’t rendered until the completion returned OR
ESCwas hit to cancel the completion, which became excessive once the index of call definition clauses was expanded by the decompilation of the Elixir standard library.beams, so disable it. If bare-words completion is restored. It will either (1) need to not use theReference#getVariants()API because it generates too many objects that need to be thrown away or (2) need to only complete call definition clauses that are provably in-scope from imports or other macros.
- #636 - @KronicDeth
- Both intellij-erlang and intellij-community are Apache 2.0 licensed and its the default license for Elixir projects, so seems like a good choice for
LICENSE.md - Add
CODE_OF_CONDUCT.md
- Both intellij-erlang and intellij-community are Apache 2.0 licensed and its the default license for Elixir projects, so seems like a good choice for
- #638 - @KronicDeth
- The run configurations I put together in #504 didn’t allow for the debugger to work properly: neither pause nor breakpoints had any effect, so regenerate them from the Gradle pane.
- Check parent of
whenoperation in case it’s a guarded function head inorg.elixir_lang.annonator.Parameter.putParameterized(Parameter, PsiElement) - Instead of highlighting call definition clauses when they are referred to, which only works if it is in the same file, highlight all function and macro declarations when the
def*call is encountered. - Only increment arity for right pipe operand instead of all operands, so that left operands resolve to correct arity or as variable/parameter.
- #662 - @KronicDeth
- Override
ModuleImpl#getProject()to preventStackOverflowError. Without overriding#getProject(),IdentifierHighlighterPassgets stuck in a loop betweengetManagerandgetProjecton the target (theModuleImpl) when clicking on the space betweendefs ordefmacros in the decompiled.beamfiles. - Fix source formatting
- Skip looking for variables unless 0-arity AND no arguments
- Highlight unresolved macros as macro calls. Anything with a do keyword or a do block will be treated like a macro call even if it can’t be resolved. No resolved is either no resolve results or an empty list
- Implicit imports at top of file in addition to top of Module.
- Override
- #663 - @KronicDeth
CallDefinitionClausecompletion provider is unexpectedly invoked both when.is typed, but continues to be invoked after a letter is typed after the.; however, once the letter is typed, the letter becomes the default prefix instead, so the prefix should only be reset to""when it ends in..- Disable
Callable#getVariantsunlessUnqualifiedto prevents local functions and macros being shown as completions for qualified names.
- #651 - @StabbyMcDuck
- Among many other tweaks, the String color is now green, so that Atom and String are no longer close to one another, which was the original issue in #569
Aliasnow hasunderscoredeffectBracketsare now greenish instead of brownishCallbacksare now a lighter blue and hasunderscoredeffectCharListis little lighterCharTokenis dark yellow now instead of dark purpleDotis now purple instead of dark redExpression Substitution Markis a little lighterInterpolationis now lime greenKernel Macrosare a burnt orangeMapis now a dark blue instead of a dark yellowOperation Signis a little lighterParametersare a little darkerParenthesesare redderPredefinedis orange instead of blueSpecificationis now red instead of purpleStructis now purple instead of yellowTypeis now green instead of dark purpleVariableis more tealish
- Among many other tweaks, the String color is now green, so that Atom and String are no longer close to one another, which was the original issue in #569
- #650 - @StabbyMcDuck
- Fix indentation to fix sub-lists in
CONTRIBUTING.md - Fix pluralization in
CONTRIBUTING.md
- Fix indentation to fix sub-lists in
- #664 - @KronicDeth
- Check if resolve results are
nullforFor.resolveResultList - Check if
Protocol.resolveResultListisnull
- Check if resolve results are
- #665 - Check
matchCallis anUnqualifiedNoArgumentCall, in addition to being 0 resolved final arity, before checking if the name matches. - @KronicDeth
Incompatible Changes
- #585 - Move
^^^to its own three-operator precedence level to match1.2. This does mean the parsing will be wrong for Elixir1.1, but is simpler than maintaining two grammars for those that are still using Elixir1.1- @KronicDeth - #504 - The
antbuild files have been removed. To build the build plugin (for Install From Disk), use the./gradlew buildPlugin. - @JakeBecker - #640 - Change to module attribute folding to off by default. - @KronicDeth
README Updates
Decompilation
.beam files, such as those in the Elixir SDK and in your project’s build directory will be decompiled to equivalent def and defmacro calls. The bodies will not be decompiled, only the call definition head and placeholder parameters. These decompiled call definition heads are enough to allow Go To Declaration, the Structure pane, and Completion to work with the decompiled .beam files.
Installation
Inside IDE using JetBrains repository
- Preferences
- Plugins
- Browse Repositories
- Select Elixir
- Install plugin
- Apply
- Restart the IDE
Inside IDE using Github releases
In browser
- Go to releases.
- Download the lastest zip.
In IDE
- Preferences
- Plugins
- Install plugin from disk…
- Select the downloaded zip.
- Apply
- Restart the IDE.
Popular in Announcing
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance










