ignatov / intellij-erlang

Erlang IDE
https://www.jetbrains.com/help/idea/2018.2/getting-started-with-erlang.html
Other
735 stars 120 forks source link

Erlang/rebar3 properly handle {vsn, git} in .app.src files - reported as error in plugin #968

Open p-kraszewski opened 2 years ago

p-kraszewski commented 2 years ago

Report

Erlang & rebar3 properly handle {vsn, git} in .app.src files.

Plugin incorrectly reports <expression> expected, got 'git' for that construct.

Environment

ignatov commented 2 years ago

Could you please add a tiny example of a code with "errors", that's going to be very handy.

p-kraszewski commented 2 years ago

Yes, of course.

Input files

The source is unmodified rebar3 new app, except for mylib.app.src.

{application, mylib,
 [{description, "An OTP application"},

  %% The following line is correct and is properly handled by Erlang compiler
  {vsn, git},

  {registered, []},
  {mod, {mylib_app, []}},
  {applications,
   [kernel,
    stdlib
   ]},
  {env,[]},
  {modules, []},
 ]}.

Reported error

The error marked for that line is <expression> expected, got 'git'

State of GIT of application

The git log is as follows:

commit 3b7623e8196842cb2b599ca411a8ffa0cc812af8 (HEAD -> master)
Author: XXX
Date:   Mon Apr 18 10:42:49 2022 +0200

    Fixed app.src

commit 35de76f7e4233d35e81dd15d55157585e5a6e484
Author: XXX
Date:   Mon Apr 18 10:41:45 2022 +0200

    Added lock

commit 49edc2375c15be130693adde2958cba9a7dca120 (tag: v1.0)
Author: XXX
Date:   Mon Apr 18 10:29:00 2022 +0200

    Initial commit

Output files

the autogenerated _build/default/lib/mylib/ebin/mylib.app is as follows:

{application,mylib,
             [{description,"An OTP application"},
              {vsn,"1.0+build.3.ref3b7623e"},
              {registered,[]},
              {mod,{mylib_app,[]}},
              {applications,[kernel,stdlib]},
              {env,[]},
              {modules,[mylib_app,mylib_sup]}]}.

which is the expected behavior.