From: Eshel Yaron Date: Thu, 10 Nov 2022 18:13:16 +0000 (+0200) Subject: FIXED: find user predicate definitions more reliably X-Git-Tag: V8.5.20-sweep-0.8.5~2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ef28a363df2eb9521b070150009cbf382b4fb821;p=sweep.git FIXED: find user predicate definitions more reliably --- diff --git a/sweep.pl b/sweep.pl index 9f42fd0..ffde94b 100644 --- a/sweep.pl +++ b/sweep.pl @@ -349,12 +349,12 @@ sweep_predicate_location_(H, Path, Line) :- !, atom_string(Path0, Path). sweep_predicate_location_(H, Path, Line) :- - xref_defined(Path0, H, How), - atom_string(Path0, Path), - ( xref_definition_line(How, Line) + ( xref_defined(Path0, H, How), + xref_definition_line(How, Line) -> true - ; Line = [] - ). + ; xref_defined(Path0, H, _), Line = [] + ), + atom_string(Path0, Path). sweep_predicate_location_(M, H, Path, Line) :- predicate_property(M:H, file(Path0)), @@ -362,12 +362,16 @@ sweep_predicate_location_(M, H, Path, Line) :- !, atom_string(Path0, Path). sweep_predicate_location_(M, H, Path, Line) :- - xref_defined(Path0, M:H, How), - atom_string(Path0, Path), - ( xref_definition_line(How, Line) + ( xref_defined(Path0, M:H, How), + xref_definition_line(How, Line) -> true - ; Line = [] - ). + ; xref_defined(Path0, H, How), + xref_definition_line(How, Line), + xref_module(Path0, M) + -> true + ; xref_defined(Path0, M:H, _), Line = [] + ), + atom_string(Path0, Path). sweep_local_predicate_completion(Sub, Preds) :- sweep_current_module(M),