Releases: KronicDeth/intellij-elixir
v13.0.0
Changelog
v13.0.0
Incompatible Changes
- #2594 - @KronicDeth
- Drop support for IDEEs before 2022.1.
Enhancements
- #2594 - @KronicDeth
- Support 2022.1 IDEs
- Update IntelliJ Plugin Gradle to 1.5.3.
- Set untilBuild explicitly
- Target JVM Version 11
- Support 2022.1 IDEs
- #2633 - @KronicDeth
- Expand
untilBuild
to cover PATCH releases of 2022.1.
- Expand
Bug Fixes
- #2594 - @KronicDeth
- Fix (some) plugin verifier warnings
- Fix (some) deprecation warnings.
- Use fewer Internal APIs.
- Fix (some) plugin verifier warnings
- #2633 - @KronicDeth
- Don't use ElixirModuleType to check if it is available.
It will not load in IDEs that lackJavaModuleBuilder
, which is why I was hard coding the ran previously. - Don't use
XmlSerializer
as equivalent ofDefaultJDOMExternalizer
TheDefaultJDOMExternalizer
method calls weren't writing anything and the explicit attribute value accesses were,
so it is more correct to just remove the original deprecated calls.
- Don't use ElixirModuleType to check if it is available.
v12.2.1
Changelog
v12.2.1
Bug Fixes
- #2579 - @KronicDeth
-
Don't call
.navigationElement
to prevent unnecessary decompilation when resolving references or showing
completions.- Don't call
navigationElement
inChooseByNameContributor
- Don't decompile Protocols to get their specific
t
type - Don't call
.navigationElement
when resolving built-in types in:erlang
- Don't use
navigationElement
inCallDefinitionClause.implicitImports
forKernel
and
KernelSpecial.Forms
. - Don't call
.navigationElement
inreference.resolver.Module.multiResolveProject
Prevents decompiling modules when doing completion.
Handle
PsiCompiledElement
in places that previously only handled source and decompiledCall
sgetElementDescription
for ModuleImpl- Complete call definition under binary modules
- Don't look for variables in compiled elements
- Don't assume elements have a non-null node Decompiled elements don't
- Index
TypeDefinition
s in .beam files Only supported built-in types faked in:erlang
for now - Walk
ModuleImpl
forscope.Type
- Don't call
-
v12.2.0
Changelog
v12.2.0
Enhancements
- #2461 - @KronicDeth
- Test against support IDEA versions in CI to prevent another Find Usage regression
- 2021.2.3 FindUsageTests differ from manual testings, so don't test 2021.2.3
- Make FindUsagesTest UsageViewTreeText work for both 2021.1.3 and other versions
- Add kernel.ex to all Find Usage Tests to ensure it doesn't work because it can't resolve primary element
- Add find usages for def test
- Test against support IDEA versions in CI to prevent another Find Usage regression
Bug Fixes
- #2461 - @KronicDeth
- Work-around Find Usage bug due to temporary change in JetBrains API only in versions that have that change.
- Restore old find_usages.handler.Call
- Determine whether to resolve
FindUsageHandler
primary element based on application build number
Assume that are 213.* builds have the already resolved call. This excludes 2021.3, but not 2021.3.1, which includes the fix to restore the 2021.1.3 behaviour.
- Work-around Find Usage bug due to temporary change in JetBrains API only in versions that have that change.
- #2466 - @KronicDeth
- Fix HTML errors in
description.html
. - Add card one-liner.
- Fix HTML errors in
v12.1.0
Changelog
v12.1.0
Enhancements
- #2405 - @osbre
- Add MacPorts SDK locations to README.
- #2404 - @KronicDeth
- Update build to elixir 1.13.0
- Add support for
**
operator to lexer and parser.
Port elixir-lang/elixir#11241
- #2436 - @KronicDeth
- Color settings for each sigil name. Both the interpolating (lower case) and literal (upper case) name use the same settings.
- #2202 - @KronicDeth
- Add support for stepped ranges
Port elixir-lang/elixir#10810- Regression test for #2200
- Update CI
- Update to Elixir 1.12.3
- Update to Erlang 24.1.6
- Add support for stepped ranges
- #2447 - @KronicDeth
- Use
getUsageViewTreeTextRepresentation
to check find usages. - Regression test for #2374.
- Use
- #2448 - @KronicDeth
- Regression test for #2386
Issue #2386 had the same root cause (OtpExternalFun not being decompiled correctly) as Issue #2410, so Issue #2386 was fixed by Pull Request #2441, but since @alexxero was nice enough to upload the.beam
file for Issue #2386, I might as well add it as a regression test too.
- Regression test for #2386
- #2453 - @KronicDeth
- Regression test for #2446
Bug Fixes
- #2397 - @KronicDeth
-
Restore tests that weren't being run after 2021.3 upgrade.
Upgrading to 2021.3 dropped the number of run tests from 3741 to 1452. This was due to a change in the packaging in 2021.3 that triggered a gradle bug.- Fix test broken by missing
markdown
in plugins list
Like the need for thejava
plugin to handle thecom.intellij.modules.java
depends
inplugin.xml
, theorg.intellij.plugins.markdown
depends
neededmarkdown
added to the list to make some of the tests work. The failed tests weren't being run before after the 2021.3 upgrade. - Manually include tests instead of scanning.
Work-around gradle/gradle#18486 as described in https://jetbrains-platform.slack.com/archives/C5U8BM1MK/p1637955960051600?thread_ts=1637923961.040000&cid=C5U8BM1MK that affects running tests with ideaVersion 2021.3.- Rename ParsingTestCases with improper capitalization
- Fix test broken by missing
-
- #2404 - @KronicDeth
- Decompile
{:|, ..., ...}
as cons operator in Elixir Dbgi. - Fix missing guards when decompiling Elixr DbgI clauses using special decompiler
Guards where missing because onlydecompiler.appendSignature
was used. - Fix module.Reference.calculateDefaultRangeInElement
element.textOffset
instead ofelement.textLength
was used for end of range.
- Decompile
- #2436 - @KronicDeth
- Restore colors for char lists and strings lost with the PSI changes in e71b247.
- #2441 - @KronicDeth
- Render
OtpErlangExternalFun
correctly as remote captures (&Mod.fun/arity
).
Fixes decompilingEcto.Changeset.validate_number
.
- Render
- #2445 - @KronicDeth
- Protect ExUnit configuration
Producer
fromElixirFile
withoutVirtualFile
.
- Protect ExUnit configuration
- #2447 - @KronicDeth
Unquote.treeWalkUp
no longer assumes that the final argument tounquote
is aCall
.- Fix Find Usages for call definitions
- Don't resolve primary Find Usages element.
The primary element passed toFindUsageHandler
is now already resolved, so resolving it again for call definitions finds usages ofdef
,defmacro
, etc. - Since the element passed to
FindUsagesProvider#canFindUsageFor
, definers can no longer be excluded, so remove that check.
- Don't resolve primary Find Usages element.
- #2449 - @KronicDeth
- Don't highlight
Quote
orSigil
as normal text if part of documentation.
Since the annotators will run in arbitrary order, theTextual
annotator has to avoid annotating the same nodes as theModuleAttribute
annotator or the colors can get interleaved.
- Don't highlight
- #2450 - @KronicDeth
- Put
ENTRANCE
and Initial Visited Element in__module__.Resolver
.
- Put
- #2452 - @KronicDeth
- Keep searching when resolving type parameters if bitstring is encountered.
- #2453 - @KronicDeth
- Fix
UnaliasedName.unaliasedName
for atoms. - Restore
ElixirAtom#getName
Lost when parser was regenerated when Elixir <= 1.6 support was dropped in 679a9689cfe097018b9baa4e894d4550a84d7aac.
- Fix
README Changes
Features
SDK
Package Manager Install Locations
Package Manager | SDK Type | Directory |
---|---|---|
MacPorts | Elixir SDK |
/opt/local/lib/elixir
|
Erlang SDK |
/opt/local/lib/erlang
|
|
Erlang for Elixir SDK |
v12.0.1
Changelog
v12.0.1
Bug Fixes
- #2345 - @KronicDeth
- Override
Override org.elixir_lang.*.configuration.Factory.getId
to fix deprecation warning about the default implementation being accidentally localizable when it shouldn't be. The Elixir plugin didn't localize these name using message bundles, so this wasn't an actual risk, but overriding is the only way to silence the error.
- Override
- #2346 - @KronicDeth
- Stop look for qualifier at curly braces for
%{Alias}
.
- Stop look for qualifier at curly braces for
v12.0.0
Changelog
v12.0.0
Breaking Changes
- #2179 - @KronicDeth
- Drop support for Elixir <= 1.6.
Continuing support for Elixir <= 1.6 required special handling of the language level to support differences in precedence and operators. Removing the language level tracking allows dropping theLevel
andFilePropertyPusher
classes and all their usages, including in the parser grammar and the specialifVersion
external rule. It also eliminates the need for tests to setup the SDK since it was only needed to get the appropriate Level. This makes the tests run in 45 seconds instead of 7 minutes.
- Drop support for Elixir <= 1.6.
- #2339 - @KronicDeth
- Remove code dependent on the Erlang plugin
Erlang plugin is not 2021.3 compatible yet
- Remove code dependent on the Erlang plugin
Enhancements
- #2179 - @KronicDeth
- Resolve more calls and bindings in
Ecto.Query
calls-
Resolve bindings in
Ecto.Query.lock/3
-
Resolve bindings in
Ecto.Query.windows/3
-
Walk
preload
binding and expression -
Resolve in
update
for Ecto.Query -
Resolve
fragment
inwith_cte
-
Resolve
binding
andexpr
inEcto.Query.dynamic/1-2
-
Resolve
field
injoin(..., on: field(..., ...) ...)
Forjoin/5
, descend into the options to look foron: value
and then walkvalue
the same as the value tohaving
orwhere
in selects since they're all boolean conditions. -
Extract
ecto.query.Nested
-
Resolve
Ecto.Query.WindowAPI
functions -
Resolve reference variable src in
join(query, ..., [{src, counter}], ..., ...)
Tuple lists in join have two forms:{^assoc, a}
{src, counter}
The pinned association form was already handled because the second element was checked for a declaration, but the first element was not, so
src
in (2) could not be resolved. -
from([..] in ...)
-
Treat
or_having
the same ashaving
-
Treat
or_where
the same aswhere
-
Treat
having:
the same aswhere:
infrom
-
Treat
select_merge
the same asselect
for resolvingEcto.Query.API
. -
from(..., [elements])
-
Resolve Ecto reference variables in
left in ...
-
ModuleWalker
andNameArityRangeWalker
Reduce code by abstracting common pattern for walking library APIs.ExUnit
- Find modules declared in
test
s. - Resolve call definitions inside
describe
blocks. - Resolve variables in
assert_receive
andassert_received
. - Resolve
alias
to modules defined inside the enclosingdescribe
block. - Walk
assert
expression for variable declarations- Check for earlier bindings of variables in right operand of
=
inassert
.
- Check for earlier bindings of variables in right operand of
- Find modules declared in
- Resolve
require
as:
arguments as Aliases - Decompiler
- Erlang
- Decompile private Erlang functions
- Decompile specs from Erlang DbgI
- Decompile function bodies from Erlang DbgI
- Escape "in" when an Erlang Var in type
- Decompile types from Erlang DbgI
Fixes #2017
- Decompile Elixir function bodies using DbgI
- :erlang./(a, b) -> a / b
- :erlang.*(a, b) -> a * b
- Convert :erlang.==(a,b) to a == b
- Rewrite case to
and
when there is a badbool error too - Decompile %{struct: name, ...} as %name{...}
- Rewrite more :erlang functions to Elixir
- Rewrite case to ||
- Rewrite
case expr1 do pat1 -> true; _ -> false; end
tomatch?(pat1, expr1)
- Rewrite
if var do false else true
to!var
- Rewrite case to or
- Rewrite case to and
- Rewrite :erlang.error(E.exception(M)) to raise E, M
- Rewrite case statements to if
- Rewrite case statements to &&
- Indent all lines of spec macro string in case it is multiple @SPEC
- Erlang
- Resolve module attributes defined outside the immediate modular lexical scope
-
Resolve module attributes registered in
elixir_module.erl
to decompiled source- after_compile
- before_compile
- behaviour
- compile
- derive
- dialyzer
- external_resource
- on_definition
-
Index module attributes
Use the index to resolve module attributes when it can't be found directly by tree walking.- Defined with
Module.put_attribute/3
- Defined with
Module.register_attribute/3
- Defined in
quote
blocks
- Defined with
-
- Resolve variables to variables in any
quote
blocks
If a variable can't be resolved in the scope, try resolving it to any variable declared at the top-level of aquote
block. This helps with certain patterns ofquote
blocks used in Ecto where a variable's declaration and usage are not in the samequote
block. - Simplify CallDefinitionClause resolver for modulars
Due to the addition of skipping if the entrance is a child call, the check for only following siblings is no longer needed. Additionally, that check caused a bug because theElixirStabBody
skipped call definitions because they were new scopes. - Resolve functions declared with
Mix.Generator.embed_template
andembed_text
.
Also, new system for tracking resolves paths -import
s,defdelegate
, anduse
calls are added to the resolve results after the preferred elements are chosen for source in the same module. This prevents only theimport
showing because the actual declaration is in another module or the SDK. - Record a call as visited in its
treeWalkUp
instead of requiring the caller to do it in the passResolveState
- Record
quoteCall
as visited inQuoteMacro.treeWalkUp
- Record
unquoteCall
as visited inUnquote.treeWalkUp
- Record
unlessCall
as visited inUnless.treeWalkUp
- Record
ifCall
as visited inIf.treeWalkUp
- Record
importCall
as visited inImport.treeWalkUp
- Record
useCall
as visited inUse.treeWalkUp
- Record
- More macro specialized in Structure View
test
describe
- Resolve
Qualifer.unquote(variable)(...)
to any definition with correct arity inQualifier
. - Only calculate
element.resolvedFinalArity
once inresolvedQualified
- Implementations and Protocols
- Redo icons
- Implementations Go To Protocol line markers
- Go to Super for calls to
defimpl
function/macro
Goes to corresponding name/arity in thedefprotocol
that thedefimpl
implements. - Go to implementations line marker from defprotocol def
- Go to implementations line marker from defprotocol
- Go To Implementation from individual functions in defimpl
- Go To Implementation from defimpl Alias
- Resolve protocol function to
def
in defprotocol - Resolve defp inside of defimpl
Process declarations inside of implementation the same as modules.
- Stop
prependQualifiers
at top of file - Walk the false and true (else) branch of unless in Modules or Quote
- Walk the true and false (else) branch of if in Modules or Quote
- Port
preferred
andexpand
system fromCallables
toModules
. - Update CI build dependencies
- Resolve more calls and bindings in
- #2199 - @KronicDeth
- Regression test for #2198.
- #2201 - @KronicDeth
- Use callbacks as completions for calls.
- #2223 - @KronicDeth
- Decompiler
- Don't require
MacroNameArity
foraccept
, but useNameArity
only because no decompiler cares about the macro.
- Don't require
- Tests for Code.Identifier and String.Tokenizer
- Decompiler
- #2226 - @KronicDeth
- Structure View for
EEx.function_from_(file|string)
- Variants (completion) for functions declared by special macros.
- Functions defined by
EEx.function_from_(file|string)
exception/1
andmessage/1
defined bydefexception
*_text/0
and*_template(assigns)
functions defined byMix.Generator.embed_text
andMix.Generator.embed_template
.
- Functions defined by
- Structure View for
- #2334 - @KronicDeth
- Internal Tool for BEAM Bulk Decompilation
Decompile all .beam files in the project, modules and SDKs to check for errors in the generated Elixir code - Decompiler
- Erlang Abst
- Log decompilation errors
- Erlang Abst
- Error Reports
- Include system information in error reports
Instead of just including the plugin version, also include the Application name, edition, and version; and the Operation System name and version as these are common follow-up questions I have. - Remove tab at start of location for title of issues
- Don't include "java.lang.Throwable: " in title of issues
TheThrowable
is necessary to get a stacktrace, but not a real error.
- Include system information in error reports
- Internal Tool for BEAM Bulk Decompilation
- #2339 - @KronicDeth
- Build against
2021.3
runPluginVerifier
in GitHub Actions- Update IDEA version range supports and verified
- Fix reported compatibility warnings
- Inline deprecated bundle messages
- Don't bundle built-in markdown plugin, depend on it instead
- Build against
Bug Fixes
v11.13.0
v11.12.0
Thanks
- For reporting that
CallDefinitionHead
could not be checked if it was decompiled.- Tomoki Odaka (@odk211)
- For reporting that BEAM Chunks tab labels did not render.
- Robin Hilliard (@robinhilliard)
- For reporting
EOFException
while reading chunks from.beam
files that were incomplete. - For posting a patch to fix an EEx bug
- Alexandr Evstigneev (@hurricup)
- For posting missing
mix deps
options for determining dependency paths on disk.- Ian Mikhailov (@yanmhlv)
- Simon McConnell (@simonmcconnell)
- For reporting that there was unhandled element types in
Type
scope processor and better error handling was necessary.- Donald Wilson (@donaldww)
- For reporting that MIssing SDK error was not helpful in Dialyzer Service.
- Walter Weinmann (@walter-weinmann)
- Klaus Ferreira (@KlausEverWalkingDev)
- Changyu Geng (@KingMario)
- @snow-dev
- @marcel862
- Ram Kumar (@ramka001)
- For reporting Stack Overflows in
Callable.annotate
due to improper tracking of modular children leading to looping when there is more than oneuse
.- @ehayun
- Tomoki Odaka (@odk211)
- Matt Pinkstron (@mpinkston)
- Sergey Snozyk (@nmbrone)
- Kevin Hagel (@kevinhagel)
- Surya Teja Muthyala (@suryatejamuthyala)
- Simon McConnell (@simonmcconnell)
- Daniil Nevdah (@ndan)
- Donald Wilson (@donaldww)
- Walter Weinmann (@walter-weinmann)
- Moein (@amoein)
- Jonathan (JC) Chen (@dijonkitchen)
- For pointing to Yacto as a reproduction repository for a bunch of bugs
- Tomoki Odaka (@odk211)
Changelog
v11.12.0
Bug Fixes
- #1988 - @KronicDeth
- Only descend into modular children of modular for Module scope. Prevents recursion loops on use calls.
- Don't search for unquoted variable value variable is value for
do:
. - Protect from
IndexNotReady
inresolver.Module.multiResolveProject
. - Stop walking unquoted variable that resolves to a parameter.
- Walk case in
__using__
to find quote in any clause. Fixes resolving test macro fromuse PowerAssert
- Resolve functions declared in
quote
's scope whenblock
injected withunquote(block)
.
Fixes resolvingfield
,timestamps
, andindex
inschema
foruse Yacto.Schema
as it makes theblock
see theimport Yacto.Schema
aboveunquote(block)
in thequote
inschema(..., do: block)
.
- #1990 - @KronicDeth
- Convert MissingSDK errors for Dialyzer into Notifications.
- #1993 - @KronicDeth
- Log element in psi.scope.Type instead of using
TODO()
Error will still be reported, but there will be enough information to triage and sincetrue
is returned now it won't stop the type resolving from working.
- Log element in psi.scope.Type instead of using
- #1994 - @KronicDeth
- Add missing mix deps options to non-path influencing list:
- env
- manager
- repo
- sparse
- submodules
- system_env
- Add missing mix deps options to non-path influencing list:
- #1995 - @hurricup]
- Fix incorrect
OuterElementType
ineex.lexer.TemplateData
.
TheEEX
IElementType
needs to useOuterLanguageElementType
instead of the directeex.psi.TokenType
.
- Fix incorrect
- #1996 - @KronicDeth
- Run
QualifiedAlias#text
inrunReadAction
forQualifiedAlias#name
- Run
- #1997 - @KronicDeth
- Return
null
Chunk
instead of throwingIOException
when read incomplete.
Incomplete reads happen often due to incomplete writes to the file system being read in. As such, they shouldn't generate error reports and instead should be silently ignored.
- Return
- #1999 - @KronicDeth
- Implement
beam.FileEditor#getFile
to fixDeprecatedMethodException
as the default implementation is now deprecated and requires an explicit implementation. - Use
TabbedPaneWrapper.AsJBTabs
instead ofJBTabbedPane
for "BEAM Chunks" tabs.
I'm not sure whyJBTabbedPane
stopped showing its labels sometime in the 2020.X IDE version series, but by debugging when "BEAM Chunks" name was retrieved I found that the bottom tabs usedTabbedPaneWrapper.asJBTabs
. Using that, the labels reappeared.
- Implement
- #2000 - @KronicDeth
- Don't require Alias qualifier to be a
PsiNamedElement
.
It can be anElixirAtom
and getting the reference will still work.
- Don't require Alias qualifier to be a
- #2001 - @KronicDeth
Any.isDecompiled
forCallDefinitionHead
.
Enhancements
- #1988 - @KronicDeth
-
Find
Dep
s in function calls in thedeps()
list. -
Dep.putPath
from a variable. -
Treat
Memoize
defmemo
asdef
anddefmemop
asdefp
. -
Resolve
exception/1
andmessage/1
todefexception
. -
Resolve to callbacks when searching in any module.
-
Support arity intervals for unquote_splicing in parameters
Functions defined with unquote_splicing, such as
Ecto.Schema.__schema/2
:for clauses <- Ecto.Schema.__schema__(fields, field_sources, assocs, embeds), {args, body} <- clauses do def __schema__(unquote_splicing(args)), do: unquote(body) end
Need to have their arity not be the number of PsiElements in the parentheses. Any call to
unquote_splicing(...)
can end up have 0 to infinite parameters, so it means when one is saw, the range ofminimum...maximum
should change to an open interval ofminimum...
. This required changingIntRange resolvedFinalArityChange()
toArityInterval resolvedFinalArityInterval()
on allCall
s, which was a large change. It also meant changing a lot of ArityRange types to ArityInterval, and NameArityRange to NameArityInterval, which influenced the variable names.Since all Calls support ArityIntervals now and not just special forms and Ecto DSLs, exportArity is changed to always state the ResolveState, so that the special form changes can be integrated for all callers.
The actual implementation of CallImpl.resolvedFinalArityRange is changes to fold over the ArityInterval:
- Normal arguments increase the minimum and maximum.
- Default arguments increase only the maximum.
- unquote_splicing changes the maximum to null to indicate the interval is half open.
-
v11.11.0
Thanks
- For reporting that Ctrl+Click / Go To Declaration did not work anymore in newer version of IntellIJ
- Joshua Taylor (@joshuataylor)
- Tomoki Odaka (@odk211)
- Ivan Shpotenko (@IvanShpotenko)
- Sergey Kislyakov (@Defman21)
- Raffael Krebs (@kreba)
- Dmitry Arkhipenko (@dkgitdev)
- Christopher Bach (@muspellpete)
- Chris Martin (@ trbngr)
- For helping me on JetBrains Platform slack and pointing out that the 2020 series of IDEs broke their plugins too.
- For confirming that JetBrains changed the API in 2020 to favor declaration instead of references and because of Elixir macros everything could be a declaration, which broke macro heavy languages like Clojure and Elixir
- Daniil Ovchinnikov (@dovchinnikov)
Changelog
v11.11.0
Enhancements
- #1948 - @KronicDeth
- Reference Resolution
-
Allow any Alias in a chain to have references.
This allows going to the declaration ofPhoenix
,Phoenix.LiveView
, orPhoenix.LiveView.Socket
depending on whether you're on thePhoenix
,LiveView
, orSocket
Alias, respectively, in the chain.-
Allow any Alias in Qualified Alias to be resolved
This allows going to the declaration of Phoenix, Phoenix.LiveView, or Phoenix.LiveView.Socket depending on whether you're
on the Phoenix, LiveView, or Socket Alias, respectively, in the chain. -
Update DocumentationProvider to work with improved Alias resolution
Without these changes the DocumentationProvider double-resolves and so ends up showing the docs for
def
anddefmodule
, instead of the call definition clause or module, respectively.
-
-
Reimplement Module references
Instead of references for only the outermost QualifiableAlias, there is a reference for each right-most Alias at a given position, so instead of there only be a reference toApp.Context.Schema
inApp.Context.Schema
, there is now a reference toApp
in theApp
prefix, a reference toApp.Context
inContext
inApp.Context
, and a reference toApp.Context.Schema
inSchema
inApp.Context.Schema
. Not only is this more useful, being able to jump to parent namespaces, but it fixed some of the capability issues with Go To Definition in the 2020 line of IDEs. This approach of usinggetRangeInElement
to target the range of the right-most Alias, while the element was still the parent that contained, but did not go beyond the Alias, was tried after having references only onAlias
es and notQualifiedAlias
es did not fix completion issues. It was the while debugging Go To Declaration actions and noticing they were sensitive to the range in element AND the docs for PsiReference#getRangeInElement that I realized that the Go To Declaration and Completion has a hidden requirement that References for things that behave like namespaces have to work this way.- Use
ModularName
index for Module Variants
Have a smaller index to iterate and remove need for theisAlias
check.
- Use
-
Limit Elixir Module resolution to same JetBrains Project Module
- Change the
GlobalSearchScope
fromallProject
tomoduleWithDependenciesAndLibrariesScope
for faster searching on multi-module projects.- Set
includeTests
based whether the referring element is in a test directory.
- Set
- Use
StubIndex#processElements
instead of home grownforEachNavigationElement
asprocessElements
is more efficient.
- Change the
-
Favor Module
ResolveResults
under sameModule
content roots
This should favor deps sources in the same module. -
Iterate
function
body inunquote(function())
when iterating call definition clauses inquote
Treats itfunction
body the same as a__using__
body. -
Standardized preferred
ResolveResult
filters between Callables and Modules- Prefer valid results as long as it doesn't leave no results.
- Prefer results in the same module as long as it doesn't leave no results.
In Go To Declaration also:
- Prefer results in source (that aren't decompiled) as long as it doesn't leave no results.
-
Use the second argument to
use
to determine which function is called with apply/3This pattern is used in Phoenix
__using__
, so this lets to differentiate whetherPlug.Conn.assign/3
orPhoenix.LiveSocket.assign/3
is resolved in a Controller, LiveComponent, or LiveView. -
In LEEx Templates
- Resolve function calls in
*.html.leex
templates to functions defined in the corresponding LiveComponent/View module. - Assigns
- Resolve assigns in LEEx templates to the keyword key in
assign/3
calls inupdate/2
in the LiveComponent or LiveView
Had to add back in aTargetElementEvaluator
, so that theUnqualifiedNoArgumentCall
(name
) that is the identifier in an assign (@name
) was not counted as valid target for Find Usages / Go To Declaration by itself. - Search for assigns in all call definitions in view module
Expand from justupdate
to any call definition to cover helper functions and other callbacks. Don't stop on the first valid match because with helper functions and multiple callbacks, the last write isn't obvious. - Resolve assigns set with
assign/3
- Look for
assign
calls in|>
pipelines - Resolve assigns set with
assign_new/3
- Resolve @live_action to where it is assigned Phoenix.LiveView.Channel.assign_action/2
- Find assigns in maps for assign/2
Since assign/2 accepts either a keyword list or a map, check in both types. - Resolve @Myself to where it is set in
render_pending_components
- Resolve assigns in macros with do blocks like
case
andif
- Find assigns in
live_component
calls
If an assign can't be found in the body of a LiveComponent module, then it maybe passed through from thelive_component
call itself, so look for any references to the view module (the LiveComponent) and if it is alive_component
call, then look at those assigns to try to resolve the assign name. - Resolve assigns to
live_modal
calls
live_modal
is not built intophoenix_live_view
, but it is generated byphx.gen.live
, so most projects will have it. This allowsreturn_to
, which is used use inlive_modal
, to be resolved. - Resolve
@socket
to last socket variable or call in view module. - Resolve
@flash
toput_flash/3
calls. - Resolve
@inner_content
toPhoenix.LiveView.Utils.to_rendered/2
setting the assign withput_in
- Resolve assigns in LEEx templates to the keyword key in
- Resolve aliases in
.leex
templates
Generalize the.leex
anduse
walking from call definition clauses to any scope processor lambda, so it can be used to resolve uses ofRoutes
in.leex
templates.
- Resolve function calls in
-
Resolve Types
- Have separate references specifically for Types.
- Resolve to both types declared with
@type
,@typep
, or@opaque
; and named type parameters. - Process declarations for
@type
,@typep
, and@opaque
. - Count
@callback
as declaring a Type - Resolve type
t
fordefprotocol
to where it is defined inProtocol.__protocol__
Unfortunately, this ties all protocol'st
to the same element, so Find Usage finds all protocol's types instead of just a specific module's type, but this works for projects that have source, but not yet compiled.- Favor protocol-specific decompiled
@type t
when available.
- Favor protocol-specific decompiled
- Resolve type variable to the keyword key in guards.
__MODULE__
-
Favor source over decompiled per name instead of overall for
ResolveResultOrderedSet
This allows theRoutes
alias to be resolved to the both theMyAppWeb.Router.Helpers
inalias MyAppWeb.Router.Helpers, as: Routes
in the source ofMyAppWeb
, but also the decompiledMyAppWeb.Router.Helpers
, which is necessary asMyAppWeb.Router.Helpers
is produced on compile fromrouter.ex
. -
Resolve references through
defdelegate
calls. -
Resolve
code_reloading?
in MyApp.EndpointThe generated
MyApp.Endpoint
formix phx.new
has a section to enable code-reloading at compile time:# Code reloading can be explicitly enabled under the # :code_reloader configuration of your endpoint. if code_reloading? do socket("/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket) plug(Phoenix.LiveReloader) plug(Phoenix.CodeReloader) end
Previously,
code_reloading?
variable would not resolve because psi.scope.Variable ignoreduse
calls, notuse
calls are entered and thevar!(code_reloading?)
is found inPhoenix.Endpoint.config/1
by way of theunquote(config(opts))
call in thequote
block in__using__(opts)
. -
Resolve qualified calls with unknown resolvable qualifier using only relative identifier and arity.
-
@spec
- Resolve
@spec
todefdelegate
calls. - Resolve @specs to the definitions if the definitions are in a for comprehension
- Resolve
-
Ecto
...
-
- Reference Resolution
v11.10.0
Thanks
- For reporting problems with ASDF SDKs
- River (@locopati)
- Ivan Shpotenko (@IvanShpotenko)
- Pedro Assunção (@noozo)
- @x984a
- Andrew Glassman (@aglassman)
- Don Lettrich (@drl123)
- João Evangelista (@sleepiejohn)
- O. F. K. (@OmanF)
- Maqbool (@m13m)
- Elton Lima (@eltonplima)
- Ilya Zabludovskiy (@MrLalatg)
- Douglas Correa (@douglascorrea)
- Mathieu Gautier (@MattGo)
- Jon (@jonthulu)
- Johannes (@johannesE)
- @guruarumugam
- Daya Sharma (@daya)
- Beatrix Klebe (@bklebe)
- For reporting the NPE in
Call.finalArguments
- Tomoki Odaka (@odk211)
- Heitor Polidoro (@heitorpolidoro)
- Donald Wilson (@donaldww)
- For reporting that
html.leex
was not being being parsed as HTML for the template data language.
Changelog
v11.10.0
Enhancements
- #1893 - @KronicDeth
- Simplify
onlyTemplateDateFileType
- Simplify
- #1897 - @KronicDeth
- Add missing opcodes to
Code
disassembler- OTP 23 opcode
bs_start_match4
- Current (in-development) OTP 24 opcodes
make_fun3
init_yregs
recv_marker_bind
recv_marker_clear
recv_marker_clear
recv_marker_user
- OTP 23 opcode
- Add missing opcodes to
- #1899 - @KronicDeth
- Log
PsiElement
ifCall#finalArguments
contain anull
.
- Log
- #1902 - @KronicDeth
- Suggest ASDF directories as
homepath
s for both Elixir and Erlang for Elixir SDKs.
- Suggest ASDF directories as
- #1821 - @jacekgajek
- Run 'Dialyzer based inspections (Elixir)' using Elixir SDK running
mix dialyzer
or any customizedmix
command.
- Run 'Dialyzer based inspections (Elixir)' using Elixir SDK running
Bug Fixes
- #1893 - @KronicDeth
- Use
VirtualFile#fileType
instead of EEx Type::INSTANCE when looking up extensions.
Since LEEx fileType
is a subclass of EEx's fileType
, it callstemplateDataFileTypeSet
in EEx'sType
, buttemplateDataFileTypeSet
usesINSTANCE
from EEx. By using theVirtualFile#fileType
instead, it will properly be EEx or LEEx based on the actual file extension and then it can be used to strip that off and find the DataTemplateLanguage, such asHTMLLanguage
for.html.leex
.
- Use
- #1897 - @KronicDeth
- Compare max opcode in to file to max opcode number, not ordinal.
Opcodes are 1-based, but the ordinal of the KotlinEnum
s are 0-based, so the comparison was off-by-1 when a file had the max opcode and would be incorrectly marked as too new.
- Compare max opcode in to file to max opcode number, not ordinal.
- #1899 - @KronicDeth
- Don't return null left or right infix operands in
primaryArguments
operation.infix.Normalized.leftOperand
and.rightOperand
ensures thatPsiErrorElement
is not returned: they can returnnull
when there is no left or right operand.Infix.primaryArguments
was not taking this into account and so could return anull
as one of theprimaryArguments
, which brokeCall.finalArguments
.
- Don't return null left or right infix operands in
- #1902 - @KronicDeth
- Don't attempt to execute
elixir -e "System.version |> IO.puts"
to get the version number as it requires too much of a full SDK to be built and from the Erlang paths to be correct too, which was rarely the case for ASDF. Since for Homebrew and ASDF, the directory name is the version name, this shouldn't be a loss in naming ability. If the directory name is not a parseable version it will be of the formatElixir at <path>
. This is probably more correct for installs directories that aren't versioned as SDK versions aren't updated if the version installed at the path changes, such as/usr/local/elixir
or/opt/elixir
, etc.
- Don't attempt to execute
README updates
Dialyzer
Inspection
Batch Mode
- Analyze > Run Inspection by Name... (⌥⇧⌘I)
- Type "Dialyzer"
- Select "Dialyzer based inspections (Elixir)" from the shortened list
- Hit Enter.
You'll be presented with a "Run 'Dialyzer based inspections (Elixir)'" dialog
- Change the scope if you want.
- Click "OK"
The Inspections Result Tool Pane will open and show results as each file is processed.