WhatsApp / erlang-language-platform

Erlang Language Platform. LSP server and CLI.
https://whatsapp.github.io/erlang-language-platform/
Apache License 2.0
257 stars 20 forks source link

Wrong warning: Unused record field ([missing name].queue) #63 #51

Closed Zabrane closed 2 months ago

Zabrane commented 2 months ago

Hi @robertoaloi

The linter apparently returns a warning about a valid code (see here).

How to reproduce it:

-module(foo).
-export([ test/0 ]).
-record(?MODULE, {queue :: term()}).
test() -> #?MODULE{queue = ok}.

363145430-27376f19-efae-483c-915e-c27d42069083

Many thanks Z.

robertoaloi commented 2 months ago

Thanks for reporting!

Zabrane commented 2 months ago

@robertoaloi Let me know when I can re-test the fix. Many thanks.

robertoaloi commented 2 months ago

@Zabrane Should be fixed now. Feel free to test with the latest main.

Zabrane commented 2 months ago

@robertoaloi Excellent. How am i supposed to test it? Usually, I just install ELP plugin for VSCode. Are there any instructions to follow to build it from source and configure it to work with VSCode?

Screenshot 2024-09-04 at 14 36 47

robertoaloi commented 2 months ago

@Zabrane Compile elp from source using these instructions. Then open your VS Code settings and modify elpClient.serverPath to include the path from the produce binary. Ensure you reload the window or restart VS Code to ensure the new setting is applied.

Zabrane commented 2 months ago

@robertoaloi yeah, the bug seems to be fixed. I've tested it on two different projects:

$ elp version
elp 1.1.0+local

Could you please correct the install doc here to read this:

mkdir -p ~/bin
mv target/release/elp ~/bin
export PATH=$PATH:~/bin

Screenshot_2024-09-04_at_17_42_23

Question: when the new pre-built binaries will be available for macOS (intel+arm) and Linux? Not everyone at work is allowed to install scala and rust on their local machine to compile from source (due to restrictive IT policies).

Many thanks for your help @robertoaloi

robertoaloi commented 2 months ago

@Zabrane Thanks for reporting, fixing the typo as we speak. The website itself is written in Markdown (e.g. https://github.com/WhatsApp/erlang-language-platform/blob/main/website/docs/get-started/install.md) so feel free to contribute should you find any other typo or missing information!

A release should happen this week. Ping @alanz

Zabrane commented 2 months ago

@Zabrane Thanks for reporting, fixing the typo as we speak. The website itself is written in Markdown (e.g. https://github.com/WhatsApp/erlang-language-platform/blob/main/website/docs/get-started/install.md) so feel free to contribute should you find any other typo or missing information!

A release should happen this week. Ping @alanz

@robertoaloi thanks a lot and keep up the good work.