Thanks
- Thanks to @gremlinLee, Huy Hoang (@huyh) , Ratan Paul (@RatanPaul) and @anehing for reporting
NoSuchMethoderrors onGeneratedParserUtilBase, which motivated me to actually ask JetBrains how to fix the problem, where Yann Cébron (@YannCebron) - Thanks to Alexander Merkulov (@merqlove) for opening an issue that Go To Definition didn’t work for aliases as before that the issue was just in my head. Go To Definition (and completion) for Aliased ended up being the primary feature of this release, so thanks Alexander.
- Thanks to Josué Henrique Ferreira da Silva (@josuehenrique) for reporting that Go To Symbol broke on schema metaprogramming in Ecto, which led to support for looking outside Enum.map functions for enclosing modulars.
- Thanks to Robin Hilliard (@robinhilliard) for reporting that unquoting of literal variables (
unquote({name, [], nil})in type specs was broken - Thanks to Max Baumann (@dudeman) for reproduction case in
DBConnection.Connection.sync_stop/4for variable resolution not working for pinned variable inreceiveclauses. - Thanks to Filip Haglund (@drathier), Gerard de Brieder (@smeevil), Markus Fischer (@mfn) and Alexander Tovstonozhenko (@alextov) for let me know that users wanted to be able to turn off Module directive (
alias,import,require,user) folding. - Thanks to Halil Özgür (@halilim) excellent reproduction case for revealing the reason for mystery
isParametererrors.
Changelog
v4.3.0
Enhancements
- #387 - Resolve aliased modules to their
aliascall, from the alias call, you can Go To Declaration for the module itself. - @KronicDeth- Code structure
- Module resolution uses the OpenAPI convention of
treeWalkUpnow instead of custom code. - Resolvable names has been extracted to its own class
- Module resolution uses the OpenAPI convention of
- Resolution use cases
Suffixresolves toalias Prefix.SuffixSuffix.Nestedresolves toalias Prefix.SuffixAsresolvestoalias Prefix.Suffix, as: As`NestedSuffixresolves toalias __MODULE__.NestedSuffix
- Code structure
- #389 - Completion for module aliases - @KronicDeth
- From in-file aliases
__MODULE__- In project modules (using index already used for Go To Declaration)
- #393 - In addition to
StubBased#canonicalName, there now alsoStubBased#canonicalNames, for when a call defines multiple canonical names, as is the case fordefimpl <PROTOCOL>, for: [<TYPE>, ...]. - @KronicDeth - #397 - When a aliased name is added to the module list for completion, it’s unaliased name is searched for in the
AllNameindex, if any nested modules are found for the unaliased name, then those nested names are aliased and also shown for completion. - @KronicDeth - #399 -
resolvableNameallows nested modules under multiple aliases to be completed. - @KronicDeth - #403 - By user request, the folding will be off-by-default now, but can be re-enabled, like the old behavior by checking the checkbox in Preferences > Editor > General > Code Folding > Elixir Module directive (
alias,import,requireoruse) groups. - @KronicDeth - #405 - @KronicDeth
- Resolve
as:aliased name to bothaliasanddefmodule - Complete modules nested under
as:aliased name.
- Resolve
- #409 - @KronicDeth
- Completion and reference tests for aliases:
alias Prefix.Suffixalias Prefix.Suffix, as: Asalias Prefix.{MultipleAliasA, MultipleAliasB}
- Completion and reference tests for aliases:
Bug Fixes
- #393 - @KronicDeth
defimpl <PROTOCOL>, for: [<TYPE>, ...]generates multiple canonical names, which are stored in the stub index.- When retrieved from the
AllNameindex, thedefimpl’s Implementation will render as if only thedefimpl <PROTOCOL>, for: <TYPE>was used for the<TYPE>matching the lookup name in the Goto Symbol dialog. For example, if you search forTuple,JSX.Encoder.Tuplewill match fordefimpl JSX.Encoder, for: for: [Tuple, PID, Port, Reference, Function, Any].
- When retrieved from the
- #400 - @KronicDeth
- Look outside Enum.map for enclosing macro call because
Ectodefines the clauses of__schema__(:type, ...)usingEnum.map, butenclosingMacroCallonly knews to jump over enclosing macros likefor, so a special case was added for anonymous function given toEnum.map. - Fix if-else-ordering bug where
Callappeared before operations (which are usuallyCalls) likeMatch.
- Look outside Enum.map for enclosing macro call because
- #401 - In
@type unquote({name, nil, []}) :: foo,namewill be highlighted as a type parameter even though it is not strictly the name that will appear as a type parameter. - @KronicDeth - #405 - @KronicDeth
- Resolve alias nested under aliased modules to both the
aliasanddefmodule, as resolving to only thealiasloses the nested name, so it wasn’t possible to jump to the nested name’sdefmodule. - Resolve aliased name to both the
aliasand thedefmodule, so you can skip jumping to thealiasbefore jumping to thedefmodule.
- Resolve alias nested under aliased modules to both the
- #406 - @KronicDeth
- The generated
ElixirParseruses theGeneratedParserUtilBasefromcom.intellij.lang.parser, but since that version is a synced copy, it is a snapshot ofGeneratedParserUtilBasefrom the version of GrammarKit that was current when the IDE was released. To ensure the generated parser works on all the IDEs, I copyGeneratedParserUtilBasefromorg.intellij.grammar.parserintoorg.elixir_lang.grammar.parserand then use that version inElixirParser. This ensures neither the IDE’s version nor the version in any installed GrammarKit plugin is used.
- The generated
- #409 - @KronicDeth
- Check that index name maps to an actual project element before returning it for completion as the names from
StubIndex.getInstance.getAllKeys(...)is a superset of actual keys in the actual project according to Peter Gromov of JetBrains. - Don’t index
canonicalNameif it matches the literal name, as the duplicate name leads to duplicate entries in the completion lookup.canonicalNameCollectionwas renamed tocanonicalNameSet(with type changing fromCollection<String>toSet<String>to match) to emphasize that the canonical names should be unique, butcanonicalNameSetitself should still include duplicates of name for those places where only canonical names are used.
- Use
resolvableNamefor theunaliasedNameforMultipleAliasesAliases, so that they complete correctly for nested modules. - Completion for nested modules will no longer complete with string suffixes (i.e.
SSHView) and only complete nested Aliases (i.e.SSH.Key).
- Check that index name maps to an actual project element before returning it for completion as the names from
README Changes
Completion
Aliases and Modules
When you start typing an Alias, completion will look in three locations:
aliasaliased names in the current file
a.Suffixforalias Prefix.Suffix
b.MultipleAliasAorMultipleAliasBforalias Prefix.{MultipleAliasA, MultipleAliasB}
c.Asforalias Prefix.Suffix, as: As- Indexed module names (as available from Go To Symbol)
a.Prefix.Suffixfromdefmodule Prefix.Suffix
b.MyProtocolfromdefprotocol MyProtocol
c.MyProtocol.MyStruct
i.defimpl MyProtocol, for: MyStruct
ii.defimpl MyProtocolnested underdefmodule MyStruct - Nested modules under aliased names
a.Suffix.Nestedforalias Prefix.SuffixwherePrefix.Suffix.Nestedis an indexed module, implementation or protocol name.
b.MultipleAliasA.Nestedforalias Prefix.{MultipleAliasA, MultipleAliasB}wherePrefix.MultipleAliasA.Nestedalias Prefix.{MultipleAliasA, MultipleAliasB}is an indexed module, implementation or protocol name.
c.As.Nestedforalias Prefix.Suffix, as: AswherePrefix.Suffix.Nestedis an indexed module, implementation, or protocol name.
Go To Declaration
Go To Declaration is a feature of JetBrains IDEs that allows you to jump from the usage of a symbol, such as a Module
Alias, to its declaration, such as the defmodule call.
Alias
- Place the cursor over an Alias with an aliased name setup by
alias
a.Suffixifalias Prefix.Suffixcalled
b.MultipleAliasAifalias Prefix.{MultipleAliasA, MultipleAliasB}called
c.Asifalias Prefix.Suffix, as: As - Activate the Go To Declaration action with one of the following:
a.Cmd+B
b. Select Navigate > Declaration from the menu.
c.Cmd+Click - A Go To Declaration lookup menu will appear, allowing you to jump either the
aliasthat setup the aliased name or jumping directly todefmoduleof the unaliased name. Select which declaration you want
a. Use arrow keys to select and hitEnter
b.Click
Module
- Place the cursor over a fully-qualified Alias
a.A.BinA.B.func()
b.A.Binalias A.B
c.Binalias A.{B, C} - Activate the Go To Declaration action with one of the following:
a.Cmd+B
b. Select Navigate > Declaration from the menu.
c.Cmd+Click
If you hold Cmd and hover over the Alias before clicking, the target declaration will be shown.
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.






















