Skip to content


Subversion checkout URL

You can clone with
Download ZIP


[For disscussion] New inspections, intentions and quick fixes #129

ignatov opened this Issue · 14 comments

7 participants


At the moment we have a few basic inspections and a couple of quick-fixes.
Please feel free to add a proposal about new inspections or intentions that you would like to see.


Quick fix: create a function definition that matches a function spec.


Implement behaviour.
Export function w/o checking that it's unused. It could be used inside module as well as exported but once it used inside - it cannot be exported with intention.


@vladimirk export type intention: 3de90ed


I'm not sure, maybe it's already present in the current version and I'm just doing something wrong, but goto source for OTP functions would be nice.
Otherwise there is a good project in active development for Emacs Erlang support that you maybe may get some inspiration from:
For fixtures specifically, see:

And yeah, awesome work! I was waiting for a long time for an Intellij Erlang support and the old ErlGrey plugin was not good enough.


@ignatov right, it worked now. OTP indexing probably wasn't finished yet when I tried it first.


Would be nice to have a warning on wrong number of arguments in io:format/2 or io_lib:format/2 calls, same as erlc has. For instance, for a module:



my_function() ->
  io_lib:format("~p~p", [foo]).

erlc emits:
./mymod.erl:7: Warning: wrong number of arguments in format call


Inspection: check unique clause conditions (for cases and functions).


new intention - create spec based on function


Quick fix: create function present in -export but missing in module. There's inspection that detects such functions, should be way to create them with as less typing as possible.


Quick fix: sort function clauses by matching, erm, wideness.


  • before:

    foo(Bar) ->
    foo([]) ->
  • after:

    foo([]) ->
    foo(Bar) ->

In first case Erlang compiler throws a warning like

Warning: this clause cannot match because a previous clause at line <line> always matches

Inspection: duplicate record field definition:

currently, this code is not considered erroneous, although it shoud be:

-record(myrec, {foo}).
foo() -> #myrec{foo=1, foo=3}.

Inspection: macro redefinition

-define(MACRO, aaa).
-define(MACRO, bbb).

Inspection: opaque type is not exported

see '6.3 Type declarations of user-defined types'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.