Closed oujinliang closed 11 years ago
just upgraded and am seeing the same thing
WS-129.541
Please provide code examples for reproducing.
Hi, guys! Could you please provide some information concerning your projects? Where are unresolved records and functions located? I guess they are in deps/%lib_name% folders. Please share your rebar.config and .app files and check if each directory under deps/%lib_name% contains .iml files.
Hey, thanks for looking into this.
so my project is using the standard erlang/OTP directory structure as far as I'm aware.
This is the rebar.config in the root directory of the project
{sub_dirs,["deps","apps"]}. {lib_dirs,["apps"]}. {depsdir,["deps"]}. {deps, [ {n2o, ".", {git, "git://github.com/5HT/n2o.git", "HEAD"}}, {jiffy, ".", {git, "git://github.com/davisp/jiffy.git", "HEAD"}}, {gettext, ".", {git, "git://github.com/etnt/gettext", "HEAD"}}, {sockjs, "._", {git, "git://github.com/sockjs/sockjs-erlang", "HEAD"}}, {rabbitcommon, ".", {git, "git://github.com/jbrisbin/rabbit_common", "HEAD"}}, {amqpclient, ".", {git, "git://github.com/jbrisbin/amqp_client", "HEAD"}}, {mochiweb, ".*", {git, "git://github.com/mochi/mochiweb", "HEAD"}}
]}.
The .hrl file for the app is in the apps/web/include directory of the project
No sign of .iml files in deps/%lib_name%
@oujinliang Also please specify your IDE version.
WebStorm -129.541
@jmarksharkey As I understand correctly, initially you've created the project via 'Open directory' action, right?
correct - it was an existing project.
From: Sergey Ignatov notifications@github.com To: ignatov/intellij-erlang intellij-erlang@noreply.github.com Cc: jmarksharkey jmarksharkey@yahoo.com.au Sent: Sunday, September 29, 2013 9:46 PM Subject: Re: [intellij-erlang] unresolved record/function even if rebar compilation succeeded. (#326)
@jmarksharkey As I understand correctly, initially you've created the project via 'Open directory' action, right? — Reply to this email directly or view it on GitHub.
probably related to this https://github.com/ignatov/intellij-erlang/issues/296
Thanks for quick response my IDEA version is 12.1.4 My rebar.config is as below:
{lib_dirs, ["lib"]}.
{sub_dirs, ["apps/stringprep"]}.
{erl_opts, [
{i, ["src/queue_processor/xmpush" ]},
{i, ["src/thrift" ]},
{i, ["src/rabbitmq" ]},
{i, ["src/zookeeper" ]},
{i, ["include/xmpp" ]},
{i, ["deps/xmqp_protocol/include" ]},
{i, ["deps/amqp_client/include" ]},
{i, ["deps/eredis/include" ]},
{i, ["lib/xmqp_client/include" ]},
{parse_transform, lager_transform}
]}.
{deps_dir, "./deps"}.
{deps, [ % some dependencies
]}.
some *.hrl which define the unresolved records/functions are under ./deps/%lib name %/include and under ./src/%subfolder%/
@jmarksharkey could you show me an example of your 'include' or 'include_lib' attributes which are causing the problem? It would also be great if you could point out some open source project or come up with a sample project of your own, where the issue occurs.
deadok22, this happens in absolutely every project. Clone any project and open directory. I've just tried it with bitcask.
-include("path/to/include.hrl"). - works -include("include.hrl"). - does not work, even if the lib is as usually placed in include/ directory
include directory isn't marked as "include path", as it is impossible (and imo it always should be marked by default for directory named "include") to "setup include directory in the facet correctly" in small IDE's. And there's no "Some 'include' folders are not marked as include paths" notification.
PyCharm, Gentoo Linux, if it is matter
@brigadier Sure, it's really matter.
Thank you, guys - the fix is about to come.
Hi guys, please check out the 385 build.
385th works correctly when Idea root is the same as app root (i.e. almost always). Does not work when Idea root is one directory above app root (rare case, only needed when working simultaneously with two or more somewhat related, but independent apps.
@ignatov , 385 build works fine after reimported the module (remove the module and reimport), thanks for the fix. BTW, I didn't find a way to reimport for the existing module, like maven module does.
@oujinliang we haven't this feature yet.
@brigadier PyCharm?
Yes, PyCharm
@brigadier could you please provide an example of what you're talking about? That is directory structure, 'open directory' action's root, location of includes, paths from include strings that fail to resolve.
I'm sorry, disregard my previous mesage. I was wrong when talked about idea root and app root. What does not work is includes in nested source directories. For example, in an app with the following structure:
app -
ebin -
app.app
include -
appinc.hrl
src -
foo.erl
src2 -
bar.erl
-include("appinc.hrl") works in foo.erl but shows an error in bar.erl.
rebar compiles this app just fine.
@brigadier Please try the 391 build.
Works, thank you!
inetllij-erlang version 0.5, just upgraded a few days ago.
In erlang editor, I see 'unresolved record error' like this:
But it compiled successfully with rebar (Make module) It seems I have to add non-standard include paths manually after I upgraded the plugin.