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

Can't autocomplete other module in a single folder "project" #1567

Open
DN4Davi opened this issue Oct 14, 2024 · 4 comments
Open

Can't autocomplete other module in a single folder "project" #1567

DN4Davi opened this issue Oct 14, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@DN4Davi
Copy link

DN4Davi commented Oct 14, 2024

I have a folder with two files:

%% x.erl
-module(x).
-export([a/2]).

a(X, Y) -> X + Y.
%% y.erl
-module(y).
-export([b/0]).

b() -> 
%% where i want to call `x:a(1,2),`
ok.

but i don't receive any completion from erlang_ls about the x module in the y module. Why it occurs? How to configue erlang_ls.config to solve it?

@plux
Copy link
Contributor

plux commented Oct 15, 2024

This should work, how does your project structure looks like and how does your erlang_ls.config look like?

@plux
Copy link
Contributor

plux commented Oct 15, 2024

I think I understand now. Just two files in the project root? I guess we don't support that, but expect source files to be under src/.

I think your use-case is valid, so will try to fix it :)

@plux plux added the bug Something isn't working label Oct 15, 2024
@DN4Davi
Copy link
Author

DN4Davi commented Oct 15, 2024

I think I understand now. Just two files in the project root? I guess we don't support that, but expect source files to be under src/.

Yes, is it but even when I put them into the 'src/' dir doesn't works (but if i add a rebar.config sample filie to the root in this case, it seems to work).

I think your use-case is valid, so will try to fix it :)

Thanks! 🙏

@DN4Davi
Copy link
Author

DN4Davi commented Oct 15, 2024

I found the real problem to the case of the files in the "src/" dir.
It isn't a bug in erlang_ls itself, but with the way nvim-lspconfig defines the root dir to the LSP (https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#erlangls).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants