Skip to content

Releases: KronicDeth/intellij-elixir

v14.0.0

16 Dec 18:48
965b94b
Compare
Choose a tag to compare

Changelog

v14.0.0

Incompatible Changes

Enhancements

Bug Fixes

  • #2911 - @KronicDeth
    • Don't update hex or fetch dependencies if SDK not selected when creating project.

v13.2.1

07 Oct 22:07
Compare
Choose a tag to compare

Changelog

v13.2.1

Bug Fixes

  • #2787 - @KronicDeth
    • Ignore PsiErrorElement when collecting doc comments.
  • #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.
  • #2804 - @KronicDeth
    • Ignore authors: ... for documentation when injecting Markdown.
  • #2808 - @KronicDeth
    • Stop prependQualifiers when reaching a qualified bracket operation (Alias.function[key]).
  • #2809 - @KronicDeth
    • Skip -1 and other unary operations when resolving types.
  • #2810 - @KronicDeth
    • Ignore maps at the root of files when collecting doc comments.
  • #2812 - @KronicDeth
    • Return emptySequence from childExpressions when PsiElement has no firstChild or lastChild.
  • #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"]))
  • #2858 - @KronicDeth
    • Ignore undocument script code at root of files.
      • Alias used in qualified call.
      • Integers
      • Floats
      • Tuples
  • #2890 - @KronicDeth
    • Stop ancestorTypeSpec on QualifiedMultipleAliases.
  • #2891 - @KronicDeth
    • Ignore pipelines for injecting Markdown in doc comments.
  • #2892 - @KronicDeth
    • Ignore useless warn_missing in edeliver's distillery dep.
  • #2893 - @KronicDeth
    • Stop accumulating qualifiers when bracket operation is hit either as qualifier or argument.

v13.2.0

01 Aug 20:58
4ca4cd3
Compare
Choose a tag to compare

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 Markdown
        • guard: ...
        • 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)
        • Types
          • Relative (t:NAME/ARITY)
          • Absolute (t:MODULE.NAME/ARITY)
        • Functions and Macros
          • Relative (NAME/ARITY)
          • Absolute (MODULE.NAME/ARITY)
    • Quick Documentation for more elements
      • Callbacks (@doc above @callback and @macrocallback)
      • Types (@typedoc above @type, @typep, and @opaque)
  • #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 **.

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
  1. Start with the Editor
  2. Click the "Toggle Rendered View" button in the gutter next to the editor.
  3. 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
  1. Start with the Rendered View
  2. Click the "Toggle Rendered View" button in the gutter next to the editor.
  3. 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
  1. Place the cursor over the name of callback being referneced.

  2. Display the documentation with either:

    • A keyboard shortcut: F1 to show rendered @doc
    • From the menu: View > Quick Documentation

For a function
  1. Place the cursor over the name of function being called.
  2. Display the documentation with either:
    • A keyboard shortcut: F1 to show rendered @doc
    • From the menu: View > Quick Documentation
For a module
  1. Place the cursor on a fully-qualified module name
  2. Display the documentation with either:
    • A keyboard shortcut: F1 to show rendered @moduledoc
    • From the menu: View > Quick Documentation
For a type
  1. Place the cursor over the name of a type being used.

  2. Display the documentation with either:

    • A keyboard shortcut: F1 to show rendered @typedoc
    • From the menu: View > Quick Documentation

v13.1.1

17 Jun 16:20
Compare
Choose a tag to compare

Changelog

v13.1.1

Bug Fixes

  • #2673 - @KronicDeth
    • Fix Project Initialization Failed from New > Project > Elixir
      • Catch and log IOExceptions 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 when setupProject is called differs between IDE versions, so to be safe, recursively delete.
  • #2705 - @KronicDeth
    • Fix Go To Definition for function in compiled modules.
      When switching over to delayed decompilation, ModuleImpl did not have processDeclaration overloadded, so the PsiScopeProcessor was never called on it and so the CallDefinitionClause scope processor did not check the ModuleImpl#callDefinitons.
    • Implement Deprecated metadata handling for docs from BEAM files.
  • #2709 - @KronicDeth
    • Don't assume Elixir SDK sdkAdditionalData is non-null.
  • #2711 - @KronicDeth
    • Don't restrict Run Configurations to Run in Modules to Elixir modules.
      The docs for ModuleType say the concept is meant to be deprecated, so don't enforce it and trying to load ElixirModuleType in RubyMine breaks as it tries to load ElixirModuleBuilder and therefore JavaModuleBuilder, which only works in IntelliJ.
  • #2712 - @KronicDeth
    • Add the facet in a write action in addition to setting the SDK.
  • #2717 - @KronicDeth
    • Increase SUSPECT_NAME_SET_SIZE to 20.
      Increased to cover the 15 impls of String.Chars in the geo hex package.
  • #2719 - @KronicDeth
    • Log if erl binary is not found when trying to run mix 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.

v13.1.0

01 Jun 14:45
c71d3cc
Compare
Choose a tag to compare

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 a VirtualFile.
      • 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>
  • #2687 - @KronicDeth
    • Update dependencies
      • gradle to 7.4.2
      • gradle-intellij-plugin to 1.6.0
      • Set -Xjvm-default=all for Kotlin to allow @JvmDefault interfaces
        • Needed for LanguageNewProjectWizard subclasses and associated implementations
    • New Project > Language > Elixir includes all mix options
      • --app
      • --module
      • --sup
      • --umbrella
  • #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 as mix format works at the file-level.
      • Allow mix format external formatter to be disabled.

        1. Preferences
        2. Editor > Code Style > Elixir
        3. Click the mix format tab
        4. Expand the General group
        5. Uncheck "Format files with mix format".
  • #2697 - @KronicDeth
    • Support Elixir 1.13.0 in debugger.

Bug Fixes

  • #2637 - @KronicDeth
    • Protect from null containingFile when fetching docs.
  • #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.
  • #2640 - @KronicDeth
    • Ignore tuples as type restrictions that occur during typing.
  • #2641 - @KronicDeth
    • Catch AlreadyDisposedException when trying to find module for PsiElement in mostSpecificSdk.
      • Check if the projectis disposed before using it to get module for PsiElement`.
  • #2645 - @KronicDeth
    • Look above CallDefinitionImpl for Type scope processing
      It should go up to the ModuleImpl to find the TypeDefinitionImpl.
  • #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.
  • #2672 - @KronicDeth
    • Look above <variable>.<tuple> for ancestorTypeSpec.
      • Look above <tuple> after <variable>. for ancestorTypeSpec.
  • #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
      • Mirror TypeDefinitionImpls to types in decompiled source.
        Allow TypeDefinitionImpl.getNavigation to go to decompiled types.
    • Allow types with atom keyword names to be highlight even though they are invalid names.
  • #2674 - @KronicDeth
    • Catch RuntimeException if rootProvider is already disposed.
      Catching AssertionError used to be enough in #1359, but not anymore as of #2623.
  • #2675 - @KronicDeth
    • Ignore invalid format that occur while user is typing when highlighting types
      • @type name :: String.()
      • @type String.()
      • @type S
  • #2676 - @KronicDeth
    • Restore Project configuration for Small IDEs.
      I dropped an ! when converting from equals to == when fixing the deprecation warnings, which made the Project SDK selection only be HIDDEN where it needed to be SHOWN.
  • #2679 - @KronicDeth
    • Catch StackOverflowError in find_usages.Provider.getType().
    • Element descriptions for CallDefinitionImpl
  • #2680 - @KronicDeth
    • Highlight CallDefinitionImpl references as predefined if resolved CallDefinitionImpl is in Kernel or Kernel.SpecialForms.
      Fixes highlighting def 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.
  • #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.
  • #2687 - @KronicDeth
    • Handle disposed Sdk.rootProvider by reloading the Sdk when loading ebinDirectories
    • In IntelliJ 2022, the New Project dialog changed and it no longer automatically listed ModuleType.getBuilder ModuleBuilders as potential project builders, so it looked like Elixir New Project support disappeared. Fix this by implementing the newProjectWizard.language extension that was added to control the Language switching in the new New Project dialog.
  • [#2688]](#2688) - @KronicDeth
    • Remove references to ElementClassHint in BeamFileImpl that only work in IntelliJ.
      ElementClassHint is part of the processDeclaration system used in Java and so was in the code because BeamFileImpl was original based on ClassFileImpl, but since the Elixir resolvers don't use the hint system at all, it can just be removed.
  • #2578 - @yordis
    • Remove CodeStyleSettingsProvider because it is redundant with LanguageCodeStyleSettingsProvider
  • #2695 - @KronicDeth
    • Restrict UsageTargetProvider to ElixirFiles
      Without this restriction, it tries to run when developing the plugin itself and breaks Kotlin syntax highlighting.
  • #2697 - @KronicDeth
    • Fix environment not being passed to debug runs of ESpec and ExUnit Run Configurations.
      The env from the Configuration was dropped because a local env was created to set MIX_ENV true.

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...

Read more

v13.0.0

05 May 18:18
f8d1423
Compare
Choose a tag to compare

Changelog

v13.0.0

Incompatible Changes

Enhancements

  • #2594 - @KronicDeth
    • Support 2022.1 IDEs
      • Update IntelliJ Plugin Gradle to 1.5.3.
      • Set untilBuild explicitly
      • Target JVM Version 11
  • #2633 - @KronicDeth
    • Expand untilBuild to cover PATCH releases of 2022.1.

Bug Fixes

  • #2594 - @KronicDeth
    • Fix (some) plugin verifier warnings
      • Fix (some) deprecation warnings.
      • Use fewer Internal APIs.
  • #2633 - @KronicDeth
    • Don't use ElixirModuleType to check if it is available.
      It will not load in IDEs that lack JavaModuleBuilder, which is why I was hard coding the ran previously.
    • Don't use XmlSerializer as equivalent of DefaultJDOMExternalizer
      The DefaultJDOMExternalizer 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.

v12.2.1

18 Apr 02:50
59aada8
Compare
Choose a tag to compare

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 in ChooseByNameContributor
      • 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 in CallDefinitionClause.implicitImports for Kernel and
        KernelSpecial.Forms.
      • Don't call .navigationElement in reference.resolver.Module.multiResolveProject
        Prevents decompiling modules when doing completion.

      Handle PsiCompiledElement in places that previously only handled source and decompiled Calls

      • getElementDescription 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 TypeDefinitions in .beam files Only supported built-in types faked in :erlang for now
      • Walk ModuleImpl for scope.Type

v12.2.0

14 Jan 03:43
416d348
Compare
Choose a tag to compare

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

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.
  • #2466 - @KronicDeth
    • Fix HTML errors in description.html.
    • Add card one-liner.

v12.1.0

07 Jan 19:15
7230e04
Compare
Choose a tag to compare

Changelog

v12.1.0

Enhancements

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.

  • #2404 - @KronicDeth
    • Decompile {:|, ..., ...} as cons operator in Elixir Dbgi.
    • Fix missing guards when decompiling Elixr DbgI clauses using special decompiler
      Guards where missing because only decompiler.appendSignature was used.
    • Fix module.Reference.calculateDefaultRangeInElement
      element.textOffset instead of element.textLength was used for end of range.
  • #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 decompiling Ecto.Changeset.validate_number.
  • #2445 - @KronicDeth
    • Protect ExUnit configuration Producer from ElixirFile without VirtualFile.
  • #2447 - @KronicDeth
    • Unquote.treeWalkUp no longer assumes that the final argument to unquote is a Call.
    • Fix Find Usages for call definitions
      • Don't resolve primary Find Usages element.
        The primary element passed to FindUsageHandler is now already resolved, so resolving it again for call definitions finds usages of def, defmacro, etc.
      • Since the element passed to FindUsagesProvider#canFindUsageFor, definers can no longer be excluded, so remove that check.
  • #2449 - @KronicDeth
    • Don't highlight Quote or Sigil as normal text if part of documentation.
      Since the annotators will run in arbitrary order, the Textual annotator has to avoid annotating the same nodes as the ModuleAttribute annotator or the colors can get interleaved.
  • #2450 - @KronicDeth
    • Put ENTRANCE and Initial Visited Element in __module__.Resolver.
  • #2452 - @KronicDeth
    • Keep searching when resolving type parameters if bitstring is encountered.
  • #2453 - @KronicDeth

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

07 Dec 04:27
4166e08
Compare
Choose a tag to compare

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.
  • #2346 - @KronicDeth
    • Stop look for qualifier at curly braces for %{Alias}.