Skip to content

v13.1.0

Choose a tag to compare

@KronicDeth KronicDeth released this 01 Jun 14:45
· 1210 commits to main since this release
c71d3cc

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 disabled if you only want to use the Internal Formatter.

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

Format on Save

To tun on format on save:

  1. Preferences
  2. Tools > Actions on Save.
  3. Check "Reformat code".
  4. Make sure "All file types" is set or at least "Files: Elixir" is set.
Autosave

JetBrains IDEs have autosave turned on by default when you click away from the editor window, but you can adjust the settings:

  1. Preferences
  2. Appearance & Behavior > System Settings.
  3. Check or uncheck the settings in the Autosave section.

Formattables

Directory

All files in a directory can be reformatted using the External Formatter (mix format)

File
Other File

All lines in a file can be reformatted with the External Formatter (mix format).

Current File

All the lines in the current editor tab file can be reformatted with External Formatter (mix format).

Selection

A subset of a file can be reformatted using the Internal Formatter