Open robertoaloi opened 1 week ago
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.
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?
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
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.