Skip to content

@KronicDeth KronicDeth released this Jun 3, 2018 · 382 commits to master since this release

Thanks

  • For reporting that true: and false: did not work as keyword keys
  • For reporting that creating the editor panel for the BEAM Chunks Code editor at boot raised an "Access is allowed from event dispatch thread only." error.
  • For reporting that creating the editor panel for the BEAM Chunks Documentation editor at boot raised an "Access is allowed from event dispatch thread only." error.
  • For requesting that #{ auto-close with }
  • For reporting a potential race-condition that led to pre-maturely decompiling an incomplete .beam file when it is being rebuilt.
  • For reporting that the bad .beam files that are test cases in Erlang's :kernel test code were correctly caught by the bug reporter, but they should be ignored since they're a known failure.
  • For reporting the null argument being passed for startingReference in ElixirPsiImplUtil.aliasToModular.

Changelog

v7.5.0

Enhancements

  • #1055 - Refactor ElixirPsiImplUtil into separate files tied to specific classes or interfaces to shrink its size. - @KronicDeth
  • #1073 - Complete #{ with }. - @KronicDeth
  • #1109 - @KronicDeth
    • Read Write Accessor Detector
      • Variable/Parameter declarations/rebindings are highlighted as writes while other usages are highlighted as reads.
    • Improved Find & Show Usages
      • Added Find & Show Usages for Functions at declaration and usage site
        • Multi-clause functions use all clauses as targets and find usages of all clauses.
      • Improved Find & Show Usages for Modules/Aliases
    • Improved Element Descriptions
      • It is easier to distinguish aliases and the defmodule that is being aliased because element description now include alias or defmodule before the Alias name based on how the Alias is defined in the scope.
      • Call definitions use the same presentation for Structure View and Find Usages, so that Compile/Runtime time icons, and visibility are the same in both.
  • #1111 - Regression test for #1091 - @KronicDeth
  • #1120 - Add regression tests for #1116 that test that parameter and variables can be renamed. - @KronicDeth
  • #1124 - Update IntelliJ versions in build matrix to include 2018.1 and latest patch version of other versions. - @KronicDeth
  • #1126 - @KronicDeth
    • Add Elixir 1.6.X to build matrix
    • Update grammar and quoter to match native 1.6 behavior when SDK is >= 1.6.
    • New default SDK level is 1.7 to handle builds from master.
  • #1127 - Regression test for #1105 - @KronicDeth

Bug Fixes

  • #1056 - Certain .beam files in the OTP source are purposely invalid, so ignore them when trying to parse and don't log the expected error. - @KronicDeth
  • #1060 - Log available bytes and total size when header is not FOR1. - @KronicDeth
  • #1071 - erl_abstract_code format Dbgi chunks can now be navigated similar to how elixir_erl format Dbgi chunks can be navigated. Instead of converting the Erlang Abstract Code back to Erlang, which would not be highlighted if intellij-erlang and requires the user to know Erlang, the Erlang Abstract Code is translated back to Elixir source, so you can use the Dbgi chunk view to translate Erlang to Elixir. - @KronicDeth
  • #1111 - Allow zero or more new lines after the struct name before the opening curly brace ({). - @KronicDeth
  • #1112 - @KronicDeth
    • In order to prevent Access is allowed from event dispatch thread only errors when creating read-only code editor in subtabs of the BEAM Chunks editor, only create those editors when their parent tab is selected.

      Affected tabs:

      • Code (Elixir & Erlang)
      • ExDc
      • Dbgi (Elixir & Erlang)
  • #1114 - Check for suffix instead of full match to detect predefined macros when annotating. Location strings have become more complex, such as including the file path for root level modules, so the old exact matching on the module name no longer works. - @KronicDeth
  • #1120 - Restore parameter and variable rename. It broke because the changes to make Find Usages work and have Go To Declaration default to Find Usage when there is only one target disabled the default selected element code that the VariableInplaceRenameHandler used. - @KronicDeth
  • #1121 - @KronicDeth
    • Allow module attribute declaration to resolve to itself, so that unused module attributes don't say they can't find the declaration.
    • Restore rename module attributes.
  • #1127 - Allow true and false to be keyword keys. - @KronicDeth

README Updates

Features

.beam Files

BEAM Chunks

Dbgi
Tab

The Dbgi tab appearance varies based on whether it was created with Erlang or Elixir, reflecting the fact that the Dbgi format is dependent on the backend that wrote it.

####### Elixir (:elixir_erl backend)

The Dbgi tab show the single value map entries: :file, :line, and :module.

Singletons

For the multi-value keys: :attributes, :compile_opts, and :definitions, there are individual tabs.

Multivalue Tabs

######## Attributes

The Attributes tab has the same format as the Attrs chunk.

Dbgi Attributes Table

######## Compile Options

The Compile Options tab is usually empty, much like the CInf options key for Erlang.

Table

######## Definitions

The Definitions tab is split between a tree of Module, Function/Arity and clauses.

Tree

Clicking on a clause will show only that clause, but clicking on a higher level in the tree will show all clauses in the function or the entire Module.

Clause
Function
Module

The AST stored in the definitions tab and the process of converting it back to code is not format preserves, so it will not look precisely like the source code as the AST has undergone some macro expansion before its put in the Dbgi chunk. As common idioms are understood, reversals will be add to the renderer.

####### Erlang (:erlang_abstract_code backend)

The Dbgi tab has Abstract Code and Compile Options tabs.

Dbgi Tabs

######## Abstract Code

The Abstract Code tab is split between a tree of Attributes, Functions, Function/Arity, and clauses.

Tree

Clicking on a clause will show only that clause, but clicking on a higher level in the tree will show all clauses in the function or the entire Module.

Clause
Function
Module

The abstract code stored in the :erlang_abstract_code backend format is the Erlang Abstract Format. Instead of converting the Erlang Abstract Format back to Erlang, which would require IntelliJ Erlang to highlight and annotate and for you to be used to reading Erlang, the Erlang Abstract Format is translated back to Elixir. Using the BEAM Chunk Dbgi viewer can be a way to convert compiled Erlang code to Elixir source automatically.

Find Usages and Show Usages

Find Usages is a feature of JetBrains IDEs. It is the dual of Go To Declaration. While Go To Declaration jumps from a usage to the declaration, Find Usages finds all usages that could jump to a declaration. When used on a usage, Find Usage first finds the declaration(s) and then finds usages of those declaration(s).

Find Usages will open all the found usages in the Find Tool Window (unless you have it configured to not open and jump direct if only one usage is found). If you want to jump to usages quickly, Show Usages, which opens a lookup dialog at the cursor and allows you to select a usage to jump to in the lookup dialog with the arrow keys may be more useful.

Function

  1. Place the cursor over the name of a function, such as hd in the definition def hd([h | t]]) do or hd in a usage hd(list).
  2. Active the Find Usages action with one of the following:
    • Alt+F7
    • Select Edit > Find > Find Usages from the menu.
  3. A Find Usages dialog will appear in the Find Tool Window.

If a function has multiple clauses, all clauses for the function will be resolved and used as targets.

Multiple Clauses.png

You can be sure that all clauses were correctly identified as targets because of the multiple entries in the top "Functions" target grouping.

Multiple Functions.png

If instead of bringing up the Find Tool Window, you'd like a lookup dialog above the cursor, you can use Show Usages.

  1. Place the cursor over the name of a function, such as hd in def hd([h | t]]) do
  2. Active the Show Usages action with one of the following:
    • Alt+Cmd+F7
    • Select Edit > Find > Show Usages from the menu.
  3. A Usages lookup will appear above the cursor.
  4. Select an element from the lookup to jump to that usage
Assets 3
You can’t perform that action at this time.