Skip to content

Commit

Permalink
Fix W0017 documentation
Browse files Browse the repository at this point in the history
Summary:
Address #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
  • Loading branch information
alanz authored and facebook-github-bot committed Apr 22, 2024
1 parent b92293b commit 3e23e8c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions crates/ide/src/diagnostics/undefined_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion website/docs/erlang-error-index/w/W0017.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
sidebar_position: 17
---

# W0017 - Unused Function
# W0017 - Undefined Function

## Error

Expand Down

0 comments on commit 3e23e8c

Please sign in to comment.