intellij-erlang icon indicating copy to clipboard operation
intellij-erlang copied to clipboard

custom behaviours are unresolved

Open brigadier opened this issue 7 years ago • 16 comments

Custom behaviour declarations such as

-behaviour(gen_my_behaviour).

show warning as unresolved, though file with the behaviour exists. Erlang compiles the project with no warnings at all.

brigadier avatar Aug 24 '16 19:08 brigadier

Thanks for reporting, could you please provide a small project for reproducing?

ignatov avatar Aug 24 '16 20:08 ignatov

gen_testgen and gen_testgen_impl in https://github.com/brigadier/testgen

Erlang 19.0.2 Pycharm 2016.2

brigadier avatar Aug 25 '16 07:08 brigadier

Can't reproduce

ignatov avatar Oct 12 '16 00:10 ignatov

@brigadier Amy news? I can't reproduce the issue.

ignatov avatar Jan 21 '17 13:01 ignatov

Always reproducible on my laptop, Erlang 19.1.6 (and other versions too), Pycharm 2016.2, plugin v.0.8.913 OTP is installed by kerl in /home/username/Apps/erlang/19.1.6 linux x64 gentoo image

Do you need any other info about the box and settings?

brigadier avatar Jan 21 '17 14:01 brigadier

Do you need any other info about the box and settings?

No, thanks, but will check it in PyCharm.

ignatov avatar Jan 21 '17 14:01 ignatov

I can reproduce the issue as well in IntelliJ

silviucpp avatar May 24 '17 21:05 silviucpp

Any update on a fix for this issue? It's a bit annoying to look at the error in intellij :)

Svampen avatar Jul 12 '17 11:07 Svampen

@brigadier setting sources in project settings

zyuyou avatar Sep 11 '18 03:09 zyuyou

Happens to me from time to time. It would be great if the IDE (knowing that the file exists in the project) could inform me what can be done about it.

kvakvs avatar Aug 01 '19 10:08 kvakvs

@kvakvs Do you have a stable repro?

ignatov avatar Aug 01 '19 10:08 ignatov

Can reproduce if the Rebar app has multiple apps, apps/app1 and apps/app2 directories and the behaviour is defined in an another app. https://imgur.com/T41W1qC.png The error is "Unresolved behaviour"

kvakvs avatar Aug 01 '19 10:08 kvakvs

@kvakvs Please share a sample project.

ignatov avatar Aug 01 '19 10:08 ignatov

bug762.zip

kvakvs avatar Aug 01 '19 10:08 kvakvs

This bug occurs whenever the behaviour is in a location not marked as Sources

i.e;

  • In a dep
  • In another app within your release's umbrella

To fix this, you need to mark the containing folder as Sources in the Project Structure Window.

Happening on IntelliJ IDEA 2019.3.1 & IntelliJ-Erlang 0.11.1053

artman41 avatar Jan 17 '20 18:01 artman41

This happened to me because I didn't correctly use -callback.

I was trying this pattern, which raised the error:

-export([behaviour_info/1]).

behaviour_info(callbacks) ->
    [{get_happy, 0}, {get_ecstatic, 0}];
behavior_info(_) ->
    undefined.

aaronlelevier avatar Apr 23 '22 19:04 aaronlelevier