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

Prevent signature help within anonymous functions #1344

Open
the-mikedavis opened this issue Jun 27, 2022 · 0 comments
Open

Prevent signature help within anonymous functions #1344

the-mikedavis opened this issue Jun 27, 2022 · 0 comments

Comments

@the-mikedavis
Copy link
Contributor

the-mikedavis commented Jun 27, 2022

Is your feature request related to a problem? Please describe.

Signature-help popping up for a call of a higher order function can be a bit noisy:

lists:map(fun(X) -> X * 2 end, Numbers)
%%         ^----------------^
%%                 ^ signature help shows all the way through here (and for `Numbers` as well)

especially for very large anonymous functions that span many lines and themselves have many function calls.

Describe the solution you'd like

I think we should prevent signature help from popping up when you're in an anonymous function. We could even fine-tune it to not show only when the anonymous function spans multiple lines.

What do you think?

Additional context

In order to implement this, we can add a clause to els_signature_help_provider:find_signature/4 that checks for an unmatched fun token like this existing clause but returns none.

Rust-analyzer now prevents signature-help on multi-line expressions: https://github.com/jonas-schievink/rust-analyzer/commit/4bb5df0ce54544df5cf89a08067f7b295b242020

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

1 participant