From 3e23e8c848b2b643e524b0bf955d831928c75f73 Mon Sep 17 00:00:00 2001 From: Alan Zimmerman Date: Mon, 22 Apr 2024 02:36:17 -0700 Subject: [PATCH] Fix W0017 documentation Summary: Address https://github.com/WhatsApp/erlang-language-platform/issues/23 - Fix reported documentation error - Add test to confirm the normal operation for the provided repro case Reviewed By: robertoaloi Differential Revision: D56413056 fbshipit-source-id: eaaea7279c5661135ce03d7444535c4088ef58b0 --- .../ide/src/diagnostics/undefined_function.rs | 21 +++++++++++++++++++ website/docs/erlang-error-index/w/W0017.md | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/crates/ide/src/diagnostics/undefined_function.rs b/crates/ide/src/diagnostics/undefined_function.rs index b8eae43f37..f516dffd78 100644 --- a/crates/ide/src/diagnostics/undefined_function.rs +++ b/crates/ide/src/diagnostics/undefined_function.rs @@ -229,6 +229,27 @@ mod tests { ) } + #[test] + fn module_macro() { + // https://github.com/WhatsApp/erlang-language-platform/issues/23 + check_diagnostics( + r#" + //- /src/elp_w0017.erl + -module(elp_w0017). + -export([loop/0]). + + loop() -> + timer:sleep(1000), + ?MODULE:loop(). + + //- /src/timer.erl + -module(timer). + -export([sleep/1]). + sleep(X) -> X. + "#, + ) + } + #[test] fn test_ignore_fix() { check_fix( diff --git a/website/docs/erlang-error-index/w/W0017.md b/website/docs/erlang-error-index/w/W0017.md index 3e74e8e502..cbfdf28a7d 100644 --- a/website/docs/erlang-error-index/w/W0017.md +++ b/website/docs/erlang-error-index/w/W0017.md @@ -2,7 +2,7 @@ sidebar_position: 17 --- -# W0017 - Unused Function +# W0017 - Undefined Function ## Error