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