From d2638671cbe9526fa1d4eaf7d6c59fdc55319346 Mon Sep 17 00:00:00 2001 From: DominicGame <84707541+DominicGame@users.noreply.github.com> Date: Thu, 21 Dec 2023 18:32:05 +0800 Subject: [PATCH] hrl don't have to warning unuse (#1426) --- apps/els_lsp/src/els_unused_includes_diagnostics.erl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/els_lsp/src/els_unused_includes_diagnostics.erl b/apps/els_lsp/src/els_unused_includes_diagnostics.erl index 3aae099d1..14b3e2805 100644 --- a/apps/els_lsp/src/els_unused_includes_diagnostics.erl +++ b/apps/els_lsp/src/els_unused_includes_diagnostics.erl @@ -32,7 +32,12 @@ is_default() -> -spec run(uri()) -> [els_diagnostics:diagnostic()]. run(Uri) -> - case els_utils:lookup_document(Uri) of + %% hrl don't have to warning unuse + case filename:extension(binary_to_list(Uri)) =/= ".hrl" + andalso els_utils:lookup_document(Uri) + of + false -> + []; {error, _Error} -> []; {ok, Document} ->