From 447500602e4db7eeefb785056d0a7fe839be4106 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Tue, 5 Oct 2021 11:01:15 +0200 Subject: [PATCH] [#859] Ignore test data directories. Test data directories may contain erlang files with modules names that clashes with application or system modules, ignore these directories. As one example in otp "lib/dialyzer/test/r9c_SUITE_data/src/" contains the many files that clashes. This causes among other things that jump to definition almost always jumps to the wrong place when working inside OTP. --- apps/els_core/src/els_config.erl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/els_core/src/els_config.erl b/apps/els_core/src/els_config.erl index 3fca71a2b..2fd3652ce 100644 --- a/apps/els_core/src/els_config.erl +++ b/apps/els_core/src/els_config.erl @@ -283,7 +283,15 @@ project_paths(RootPath, Dirs, Recursive) -> ) || Dir <- Dirs ], - lists:append(Paths). + case Recursive of + false -> + lists:append(Paths); + true -> + Filter = fun(Path) -> + string:find(Path, "SUITE_data", trailing) =:= nomatch + end, + lists:filter(Filter, lists:append(Paths)) + end. -spec otp_paths(path(), boolean()) -> [string()]. otp_paths(OtpPath, Recursive) ->