Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebar3 Support: Code completion in Editor and Console #268

Open
Morabaraba opened this issue Apr 27, 2016 · 9 comments
Open

Rebar3 Support: Code completion in Editor and Console #268

Morabaraba opened this issue Apr 27, 2016 · 9 comments

Comments

@Morabaraba
Copy link

disclaimer I'm new to erlang, rebar3 and erlide

Eclipse Platform 4.3.2.v20140221-1852
Erlide 0.32.201604231840
rebar 3.1.0 on Erlang/OTP 17 Erts 6.4

I created a project with rebar3 rebar3 new app luckyluke I then added {deps, [cowboy]}. to rebar.config and compile the project using rebar3 compile. It compiles to _build:

_build/default/lib/cowboy/ebin
_build/default/lib/cowlib/ebin
_build/default/lib/luckyluke/ebin
_build/default/lib/ranch/ebin

Each build also has a src directory with luckyluke linking to the base src and include.

I can execute my module with erl

erl -pa _build/default/lib/luckyluke/ebin/ -pa _build/default/lib/cowboy/ebin/ -pa _build/default/lib/cowlib/ebin/ -pa _build/default/lib/ranch/ebin/

What must I do to enable code completion in the editor and console. I already changed INTERNAL to REBAR in .settings/org.erlide.model.prefs.

Is this possible?

@vladdu
Copy link
Collaborator

vladdu commented Apr 27, 2016

At the moment, dependencies are not detected and handled. I am working on that.

Until then, you can add the dependencies to the source directories: in the project's properties, under erlang, let "source directories" be src;_build/default/lib/cowboy/src;_build/default/lib/ranch/src;_build/default/lib/cowlib/src;_build/default/lib/luckyluke/src and similar for the include directories.

@Morabaraba
Copy link
Author

Thanks, adding it worked for code completion.

I decided to use erws as a test project. When I called application:ensure_all_started(erws) it err'd

{error,{goldrush,{"no such file or directory",
                  "goldrush.app"}}}

I symlinked the *.app files into the ebin/ directory

 cd ebin/
 ln -s ../_build/default/lib/ranch/ebin/ranch.app
 ln -s ../_build/default/lib/cowlib/ebin/cowlib.app
 ln -s ../_build/default/lib/lager/ebin/lager.app
 ln -s ../_build/default/lib/goldrush/ebin/goldrush.app

I feel it is wrong, what would be the correct method?

The lager dep failed on needing a include so I added

include;_build/default/lib/cowboy/include;_build/default/lib/ranch/include;_build/default/lib/cowlib/include;_build/default/lib/lager/include;_build/default/lib/goldrush/include;

to project properties > erlang > include directories

Ran application:ensure_all_started(erws) and it worked, also stopped on my breakpoint 😄

How hard would it be to add something like src;_build/default/lib/*/src; to erlide for source and include directories in project properties? Maybe something that runs and replace when the property change gets applied.

ps. erws atm is not working for me, but it a ws issue and not erlide one.

@vladdu
Copy link
Collaborator

vladdu commented Apr 28, 2016

How hard would it be to add something like src;_build/default/lib/*/src; ?

That is a good idea!

Regarding the different *.app files, there is no good way to do that yet. The easiest way would be to do something similar for output directories (ebin:/_build/default/lib/*/ebin)

I am reopening this ticket to track these improvements.

@vladdu vladdu reopened this Apr 28, 2016
@DeadZen
Copy link

DeadZen commented Aug 8, 2017

update on the rebar3 integration status?

@vladdu
Copy link
Collaborator

vladdu commented Aug 8, 2017

Unfortunately, not much, I got focused on a different track. Are the things discussed here enough for what you need @DeadZen? I will try to implement them, hopefully that will cover most of the issues.

Edit: What I am working on now is reimplementing a lot of the code in Erlang, as a language server that can be used from multiple clients (eclipse, vscode, etc). So it feels a little bit wasteful to do it in Java too; on the other hand, the new implementation might take a while longer...

@marabunt
Copy link

update on the rebar3 integration status?

@vladdu
Copy link
Collaborator

vladdu commented Aug 17, 2020

Sorry, there has not been any development on this for a (long) while, as I no longer use it myself at work and got other projects going. Unfortunately, it's not easy for someone else to improve the code. I think the best way would be to start over using the language servers available, so that the actual functionality is handled elsewhere and here there is only an adaptation to Eclipse.

@marabunt
Copy link

It's a pity!

@spokc
Copy link

spokc commented Dec 18, 2020

Good news here ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants