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

Extract variable names from EEP-48 doc chunks when available #53

Open
robertoaloi opened this issue Sep 2, 2024 · 2 comments
Open

Extract variable names from EEP-48 doc chunks when available #53

robertoaloi opened this issue Sep 2, 2024 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@robertoaloi
Copy link
Contributor

For features such as inlay hints and doc-on-hover, ELP extracts variable names from the function specs or - when variables in specs are not available - from the first function clause.

A better option would be to extract them from the EEP-48 doc chunks (format documented here).

Originally proposed here.

@garazdawi
Copy link

For features such as inlay hints and doc-on-hover, ELP extracts variable names from the function specs or - when variables in specs are not available - from the first function clause.

If by this your mean that ELP today prioritises specs over function variable names, then atleast in my ELP (v0.28.0) it is not true.

image

The ML in this image should be Data: https://github.com/erlang/otp/blob/master/lib/stdlib/src/unicode.erl#L281-L295.

Or is this only something that does not work for me as I'm developing within the Erlang/OTP tree?

@robertoaloi
Copy link
Contributor Author

Just checked. The extraction algorithm is extremely basic right now and does not take guards into account: https://github.com/WhatsApp/erlang-language-platform/blob/main/crates/hir/src/module_data.rs#L293

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants