ivy-erlang-complete icon indicating copy to clipboard operation
ivy-erlang-complete copied to clipboard

Type name completion

Open galdor opened this issue 3 years ago • 3 comments

I've been using this module for some time (with company-erlang actually), it is so much faster than using lsp, thank you!

However I realized that completion gives me modules, and when there is a module followed by :, functions but not types. Is there a reason for that ? It would be so useful to have them. And completion frameworks are able to annotate candidates, so there could be an indication showing if a completion candidate is a function or a type.

galdor avatar Feb 08 '21 08:02 galdor

Hi! I'm glad to see this package is useful for you.

I have stopped using Erlang several years ago, so probably I will not implement this feature myself. But I will keep this issue open. Maybe someone would like to implement it. I think it's not very hard to implement.

it is so much faster than using lsp

Have you tried edts? I think it is more complex solution than this one. Probably this feature already exists in edts.

Also there is more than one language server for Erlang. Also you can tune lsp client for better performance. I use lsp-mode for go language and there are no performance issues.

s-kostyaev avatar Feb 08 '21 11:02 s-kostyaev

No problem, I'm still glad to have this package as it is.

Have you tried edts?

I did, some time ago, and I had multiple issues with it. I had better luck with lsp and erlang_ls, but ended up removing it because it spawns one Erlang instance for each project. This is a real problem when working on a dozen repositories: CPU/memory usage adds up real fast.

galdor avatar Feb 13 '21 06:02 galdor

Bonjour @galdor,

I'm starting to look at company-erlang but don't know much about the internals of company. I'll take a look and see if I can gather ways to implement what you'd like. I may have some time available for that (but can't guarantee it :-)

Can I presume that you want the completion to suggest types when point in on a -type, -record and -spec. And not in the older comment-based @type and @specEdoc declarations?

But I'm not sure I fully understand what is missing. For instance, when I type inet:port the completion provides port(_) and port-number() and I can select inet:port-number() inside a -type declaration.

Can you include an example of code that does not complete the way you would like it to complete?

pierre-rouleau avatar Nov 01 '21 20:11 pierre-rouleau