Releases: KronicDeth/intellij-elixir
v14.0.0
Changelog
v14.0.0
Incompatible Changes
- #2946 - @KronicDeth
- Drop support for IDEs < 2022.3.
Enhancements
Bug Fixes
- #2911 - @KronicDeth
- Don't update hex or fetch dependencies if SDK not selected when creating project.
v13.2.1
Changelog
v13.2.1
Bug Fixes
- #2787 - @KronicDeth
- Ignore
PsiErrorElement
when collecting doc comments.
- Ignore
- #2793 - @JamesFerguson
- Fix README typos.
- #2800 - @KronicDeth
- Log before and after setting mirror for decompiled files.
Parsing complex decompiles can freeze the IDE. Logging before parsing the decompiles will give a chance of finding the file and recovering the decompiled code to find the error or complexity that needs to be suppressed. - Use `Options.truncateDecompiledBodyz on Elixir decompiled bodies too.
Previously, this was only used for Erlang functions. Fixes parsing decompiled code causing freezes for some files.
- Log before and after setting mirror for decompiled files.
- #2804 - @KronicDeth
- Ignore
authors: ...
for documentation when injecting Markdown.
- Ignore
- #2808 - @KronicDeth
- Stop
prependQualifiers
when reaching a qualified bracket operation (Alias.function[key]
).
- Stop
- #2809 - @KronicDeth
- Skip
-1
and other unary operations when resolving types.
- Skip
- #2810 - @KronicDeth
- Ignore maps at the root of files when collecting doc comments.
- #2812 - @KronicDeth
- Return
emptySequence
fromchildExpressions
whenPsiElement
has nofirstChild
orlastChild
.
- Return
- #2814 - @KronicDeth
- Don't descend inside struct literal when resolving types.
- #2848 - @KronicDeth
- Ignore injecting Markdown in calls that read the text from a file, such as in
@moduledoc File.read!(Path.join([__DIR__, "..", "README.md"]))
- Ignore injecting Markdown in calls that read the text from a file, such as in
- #2858 - @KronicDeth
- Ignore undocument script code at root of files.
- Alias used in qualified call.
- Integers
- Floats
- Tuples
- Ignore undocument script code at root of files.
- #2890 - @KronicDeth
- Stop
ancestorTypeSpec
onQualifiedMultipleAliases
.
- Stop
- #2891 - @KronicDeth
- Ignore pipelines for injecting Markdown in doc comments.
- #2892 - @KronicDeth
- Ignore useless
warn_missing
inedeliver
'sdistillery
dep.
- Ignore useless
- #2893 - @KronicDeth
- Stop accumulating qualifiers when bracket operation is hit either as qualifier or argument.
v13.2.0
Changelog
v13.2.0
Enhancements
- #2768 - @KronicDeth
- Rendered Markdown toggle for
@moduledoc
,@typedoc
, and@doc
- Inject markdown in
@doc deprecated: ...
- Inject Markdown into doc lines and heredocs
- Ignore
false
for documentation module attributes - Ignore
@doc
metadata that can't include Markdownguard: ...
since: ...
- Ignore
@callback(unquote(spec))
when trying to find typespecs - Interleave Markdown and Elixir for doctests
- Mark code blocks as Elixir language in Markdown documentation
- Mark multi-line exceptions in doctests as Markdown
- Treat DBG prefix doctest lines as Markdown instead of Elixir
- Resolve owner of docs as following call definition clause.
- Count
...>
as Markdown since it's not Elixir syntax - Count
** (...
as Markdown since it's not Elixir syntax for exception in iex prompts - Count
iex>
as Markdown since it's not Elixir syntax
- Documentation links in rendered documentation
- Modulars
MODULE
- Callbacks
- Relative (
c:NAME/ARITY
) - Absolute (
c:MODULE.NAME/ARITY
)
- Relative (
- Types
- Relative (
t:NAME/ARITY
) - Absolute (
t:MODULE.NAME/ARITY
)
- Relative (
- Functions and Macros
- Relative (
NAME/ARITY
) - Absolute (
MODULE.NAME/ARITY
)
- Relative (
- Modulars
- Inject markdown in
- Quick Documentation for more elements
- Callbacks (
@doc
above@callback
and@macrocallback
) - Types (
@typedoc
above@type
,@typep
, and@opaque
)
- Callbacks (
- Rendered Markdown toggle for
- #2766 - @ViseLuca
- Compatibility with IntelliJ 2022.2.
- Updated Elixir version used in tests.
- Updated Gradle dependencies.
Bug Fixes
- #2768 - @KronicDeth
- Add compiled CallDefinitionImpl delegation targets to resolve results
- Log non-Call modulars for resolving delegation
- #2766 - @KronicDeth
- Fix operator token set for
**
.
- Fix operator token set for
README Updates
Features
Documentation
Documentation
Editor
Documentation in @moduledoc
, @typedoc
or @doc
module attribute values are marked as Markdown language, so that the JetBrains supplied Markdown support works in documentation.
Code Blocks
Code in code blocks (indented 4 spaces) are marked as Elixir language, so all the normal language support works in code examples and doctests.
This includes highlighting reads and writes of variables
and Go To Definition for calls
Toggling Editor to Rendered
- Start with the Editor
- Click the "Toggle Rendered View" button in the gutter next to the editor.
- Rendered View will be shown
Rendered View
Markdown documentation in @moduledoc
, @typedoc
or @doc
can be toggled back and forth from the editable Markdown view and the rendered HTML view.
Aliases link to Modules
In the rendered view, aliases are clickable and navigatable.
Clicking the links will show the documentation for module.
Using Go To Definition (Cmd+Click) on the link will take you to the module definition.
Toggling Rendered to Editor
- Start with the Rendered View
- Click the "Toggle Rendered View" button in the gutter next to the editor.
- Editor will be shown
Quick Documentation
You can get documentation for functions and macros that have a @doc
, aliases of modules that have a @moduledoc
or types that have a @typedoc
in a pop-up using Quick Documentation.
For a function
-
Place the cursor over the name of callback being referneced.
-
Display the documentation with either:
- A keyboard shortcut: F1 to show rendered
@doc
- From the menu: View > Quick Documentation
- A keyboard shortcut: F1 to show rendered
For a function
- Place the cursor over the name of function being called.
- Display the documentation with either:
- A keyboard shortcut: F1 to show rendered
@doc
- From the menu: View > Quick Documentation
- A keyboard shortcut: F1 to show rendered
For a module
- Place the cursor on a fully-qualified module name
- Display the documentation with either:
- A keyboard shortcut: F1 to show rendered
@moduledoc
- From the menu: View > Quick Documentation
- A keyboard shortcut: F1 to show rendered
For a type
v13.1.1
Changelog
v13.1.1
Bug Fixes
- #2673 - @KronicDeth
- Fix Project Initialization Failed from New > Project > Elixir
- Catch and log
IOException
s swallowed by Project Initialization Failed. - Recursively delete project directory before running
mix new
.
Previously, the directory was only deleted if empty, but whether the.idea
directory is written whensetupProject
is called differs between IDE versions, so to be safe, recursively delete.
- Catch and log
- Fix Project Initialization Failed from New > Project > Elixir
- #2705 - @KronicDeth
- Fix Go To Definition for function in compiled modules.
When switching over to delayed decompilation,ModuleImpl
did not haveprocessDeclaration
overloadded, so thePsiScopeProcessor
was never called on it and so theCallDefinitionClause
scope processor did not check theModuleImpl#callDefinitons
. - Implement Deprecated metadata handling for docs from BEAM files.
- Fix Go To Definition for function in compiled modules.
- #2709 - @KronicDeth
- Don't assume Elixir
SDK
sdkAdditionalData
is non-null
.
- Don't assume Elixir
- #2711 - @KronicDeth
- Don't restrict Run Configurations to Run in Modules to Elixir modules.
The docs forModuleType
say the concept is meant to be deprecated, so don't enforce it and trying to loadElixirModuleType
in RubyMine breaks as it tries to loadElixirModuleBuilder
and thereforeJavaModuleBuilder
, which only works in IntelliJ.
- Don't restrict Run Configurations to Run in Modules to Elixir modules.
- #2712 - @KronicDeth
- Add the facet in a write action in addition to setting the SDK.
- #2717 - @KronicDeth
- Increase
SUSPECT_NAME_SET_SIZE
to20
.
Increased to cover the15
impl
s ofString.Chars
in thegeo
hex package.
- Increase
- #2719 - @KronicDeth
- Log if
erl
binary is not found when trying to runmix format
.
Log instead of letting it throw up the stack and cause an error report since the SDK not being set will be very common.
- Log if
v13.1.0
Changelog
v13.1.0
Enhancements
- #2673 - @KronicDeth
- Improved error reporting
- Include 5 lines of context around error elements
- Use
originalFile
when calculating path, so that.beam
file path is used for decompiled files that don't have aVirtualFile
. - Compact line references
- Only including ending line if it is different than starting line.
- Add ending line as a range after starting line instead of a completely separate path and line.
- Put stacktrace in
<details>
with<summary>
- Improved error reporting
- #2687 - @KronicDeth
- Update dependencies
gradle
to7.4.2
gradle-intellij-plugin
to1.6.0
- Set
-Xjvm-default=all
for Kotlin to allow@JvmDefault
interfaces- Needed for
LanguageNewProjectWizard
subclasses and associated implementations
- Needed for
- New Project > Language > Elixir includes all mix options
--app
--module
--sup
--umbrella
- Update dependencies
- #2578 - @yordis
- Add
mix format
external formatter.
Requires project or module SDK be set in order to run. If the SDK is not available, only the internal formatter will be used. The internal formatter is still used for file subsection formatting and new line indenting asmix format
works at the file-level.-
Allow
mix format
external formatter to be disabled.- Preferences
- Editor > Code Style > Elixir
- Click the
mix format
tab - Expand the General group
- Uncheck "Format files with
mix format
".
-
- Add
- #2697 - @KronicDeth
- Support Elixir 1.13.0 in debugger.
Bug Fixes
- #2637 - @KronicDeth
- Protect from
null
containingFile
when fetching docs.
- Protect from
- #2639 - @KronicDeth
- Show notification if $HOME_PATH/lib does not exist.
Instead of logging an error show a notification since it can and does happen and is not a bug to be fixed in the
plugin, but a configuration change the user needs to do.
- Show notification if $HOME_PATH/lib does not exist.
- #2640 - @KronicDeth
- Ignore tuples as type restrictions that occur during typing.
- #2641 - @KronicDeth
- Catch
AlreadyDisposedException
when trying to find module for PsiElement inmostSpecificSdk
.- Check if the project
is disposed before using it to get module for
PsiElement`.
- Check if the project
- Catch
- #2645 - @KronicDeth
- Look above
CallDefinitionImpl
forType
scope processing
It should go up to theModuleImpl
to find theTypeDefinitionImpl
.
- Look above
- #2671 - @KronicDeth
- Have Credo Global Inspection use standard
Mix.commandLine
used for Run Configurations.- Allow environment variables to be set similar to Run Configurations for projects that require environment variables to be set for Mix tasks due to checks in their config.
- No longer support Include Explanations as it takes too long to run.
- Remove annotator until it can be re-implemented in performant manner using corrected environment and SDK from Global Inspection.
- Have Credo Global Inspection use standard
- #2672 - @KronicDeth
- Look above
<variable>.<tuple>
forancestorTypeSpec
.- Look above
<tuple>
after<variable>.
forancestorTypeSpec
.
- Look above
- Look above
- #2673 - @KronicDeth
- Fix Find Usages that resolve to compiled types.
- Add element description for
TypeDefinitionImpl
- Node Text is
@<module_attribte> <name>(<parameters>) :: ...
- Long Name and Short Name are just the
name
- Type is
type
- Node Text is
- Mirror
TypeDefinitionImpls
to types in decompiled source.
AllowTypeDefinitionImpl.getNavigation
to go to decompiled types.
- Add element description for
- Allow types with atom keyword names to be highlight even though they are invalid names.
- Fix Find Usages that resolve to compiled types.
- #2674 - @KronicDeth
- #2675 - @KronicDeth
- Ignore invalid format that occur while user is typing when highlighting types
@type name :: String.()
@type String.()
@type S
- Ignore invalid format that occur while user is typing when highlighting types
- #2676 - @KronicDeth
- Restore Project configuration for Small IDEs.
I dropped an!
when converting fromequals
to==
when fixing the deprecation warnings, which made the Project SDK selection only be HIDDEN where it needed to be SHOWN.
- Restore Project configuration for Small IDEs.
- #2679 - @KronicDeth
- Catch
StackOverflowError
infind_usages.Provider.getType()
. - Element descriptions for
CallDefinitionImpl
- Catch
- #2680 - @KronicDeth
- Highlight
CallDefinitionImpl
references as predefined if resolvedCallDefinitionImpl
is inKernel
orKernel.SpecialForms
.
Fixes highlightingdef
and other defined when using SDKs without source like Homebrew after the delayed-decompilation fixes from 12.2.1. Now source-less (Homebrew) and SDKs with sources (ASDF) will both be able to highlight predefineds.
- Highlight
- #2681 - @KronicDeth
- No longer record the SDK name as an attribute of the Facet configuration, as it didn't write back changes.
- Instead detect the Elixir SDK by finding any of the libraries that have an Elixir SDK name in the module. (The Elixir SDK was already being added as a library to allow indexing the SDK.)
- Clear out any existing Elixir SDKs listed as module libraries before setting a new SDK.
This eliminates the duplicates that happened before. (It turns out the JetBrains API doesn't prevent duplicates. Oopsie.) It also ensures that no SDK is recorded if the SDK is deselected in the UI, which wouldn't happen before.
- No longer record the SDK name as an attribute of the Facet configuration, as it didn't write back changes.
- #2687 - @KronicDeth
- Handle disposed
Sdk.rootProvider
by reloading theSdk
when loadingebinDirectories
- In IntelliJ 2022, the New Project dialog changed and it no longer automatically listed
ModuleType.getBuilder
ModuleBuilder
s as potential project builders, so it looked like Elixir New Project support disappeared. Fix this by implementing thenewProjectWizard.language
extension that was added to control the Language switching in the new New Project dialog.
- Handle disposed
- [#2688]](#2688) - @KronicDeth
- Remove references to
ElementClassHint
in BeamFileImpl that only work in IntelliJ.
ElementClassHint
is part of theprocessDeclaration
system used in Java and so was in the code becauseBeamFileImpl
was original based onClassFileImpl
, but since the Elixir resolvers don't use the hint system at all, it can just be removed.
- Remove references to
- #2578 - @yordis
- Remove
CodeStyleSettingsProvider
because it is redundant withLanguageCodeStyleSettingsProvider
- Remove
- #2695 - @KronicDeth
- Restrict
UsageTargetProvider
toElixirFile
s
Without this restriction, it tries to run when developing the plugin itself and breaks Kotlin syntax highlighting.
- Restrict
- #2697 - @KronicDeth
- Fix environment not being passed to debug runs of ESpec and ExUnit Run Configurations.
Theenv
from theConfiguration
was dropped because a localenv
was created to setMIX_ENV
true
.
- Fix environment not being passed to debug runs of ESpec and ExUnit Run Configurations.
README Updates
Features
Credo
Inspection
Batch Mode
If you'd like to run mix credo
use can run it as a global Inspection.
Formatting
IntelliJ Elixir both has an internal formatter used to format new linees and parts of files, but also can use mix format
to format entire files.
Formatters
Internal
IntelliJ Elixir's internal formatter can reformat code to follow a consistent style.
External (mix format
)
IntelliJ Elixir will run mix format -
on the text of the file. As mix format
works on entire files, only whole
file, multiple file, or directory formatting is supported using this external formatter. Formatting subsections and
new lines use the internal formatter until the next full file format uses mix format
.
NOTE: The module or project SDK MUST be set in order to run mix format
. If the SDK is not set, only the internal formatter will be run.
Disabling
mix format
can be d...
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