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

Either add functions to existing export attribute or create a new export attribute #1462

Open
fridayy opened this issue Nov 7, 2023 · 0 comments
Labels

Comments

@fridayy
Copy link
Contributor

fridayy commented Nov 7, 2023

Is your feature request related to a problem? Please describe.
Currently, the export_function/4 code action on unused functions always adds a new -export([some_fun/0]) module attribute. Which is totally fine from a functional perspective.

-module(some).

-export([some_fun/0]).
-export([some_fun/1]).
-export([another_fun/3]).
...

However I prefer the -export([[Name1/Arity1, ..., NameN/ArityN]). style of doing exports thus I catch myself manually merging the generated exports into a single export all the time.

-module(some).
-export([
    some_fun/0,
    some_fun/1,
    another_fun/3
]).

Describe the solution you'd like
Alternatively create a new -export() or add the unused function to an existing -export().

Additional context
From my limited experience there are many -export() styles and of course all of this is highly subjective. An implementation satisfying all possible scenarios just add lots of accidental complexity. However I think a simple implementation like either add a new export or add it to "last" existing export would suffice and still be helpful.

I did a quick experiment here.

Happy to hear your opinion on this and I hope my remarks make sense. Thank you for for erlang_ls and have a nice day 👍

@plux plux added the feature label Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants