]> git.eshelyaron.com Git - sweep.git/commitdiff
FIXED: sweeprolog-identifier-at-point could return unbound module
authorEshel Yaron <me@eshelyaron.com>
Fri, 28 Oct 2022 16:00:58 +0000 (19:00 +0300)
committerEshel Yaron <me@eshelyaron.com>
Sat, 5 Nov 2022 17:50:25 +0000 (19:50 +0200)
sweep.pl

index 1fcdf02e40f235e80805709c1c3dd233e3e9c30c..525ab6e178edecb1640c456f98806da263ac0dfc 100644 (file)
--- a/sweep.pl
+++ b/sweep.pl
@@ -96,7 +96,7 @@
 
 :- multifile prolog:xref_source_time/2,
              prolog:xref_open_source/2,
-             prolog:xref_open_source/2,
+             prolog:xref_close_source/2,
              prolog:quasi_quotation_syntax/2.
 
 prolog:quasi_quotation_syntax(graphql, library(http/graphql)).
@@ -305,7 +305,10 @@ sweep_handle_identifier_at_point_goal(_Path, _M0, Extern, Goal) :-
     sweep_is_extern(Extern, M),
     !,
     pi_head(PI, Goal),
-    asserta(sweep_current_identifier_at_point(M:PI)).
+    (   var(M)
+    ->  asserta(sweep_current_identifier_at_point(PI))
+    ;   asserta(sweep_current_identifier_at_point(M:PI))
+    ).
 sweep_handle_identifier_at_point_goal(_Path, _M0, autoload(Path), Goal) :-
     !,
     pi_head(PI, Goal),
@@ -385,7 +388,7 @@ sweep_documentation(PI0, Docs) :-
     term_string(PI1, PI0),
     (   PI1 = M:PI
     ->  true
-    ;   M=user, PI=PI1
+    ;   PI=PI1
     ),
     findall(Doc, sweep_documentation_(M, PI, Doc), Docs).