definition, ideally with optional =PlDoc= comments (see [[#sweeprolog-pldoc][Documenting
predicates]]).
-- Improve the information provided for predicate completion candidates :: predicate
- completion with ~C-M-i~ should annotate each completion candidate with
- the names and modes of its arguments, when available. E.g. say
- ~foo(+Bar, -Baz)~ instead of ~foo/2~.
-
- Make predicate completion aware of module-qualification :: predicate
completion should detect when the prefix it's trying to complete
starts with a module-qualification ~foo:ba<|>~ and restrict completion
))))
+(ert-deftest complete-predicate-with-args ()
+ "Tests completing predicate calls."
+ (let ((temp (make-temp-file "sweeprolog-test"
+ nil
+ ".pl"
+ "
+:- module(foobarbaz, []).
+
+%! foobarbaz(:Bar, ?Baz:integer) is det.
+
+foobarbaz(_, 5) :- spam.
+
+spam :- foobarb
+"
+ )))
+ (find-file-literally temp)
+ (sweeprolog-mode)
+ (goto-char (point-max))
+ (backward-char)
+ (call-interactively #'completion-at-point)
+ (should (string= (buffer-string)
+ "
+:- module(foobarbaz, []).
+
+%! foobarbaz(:Bar, ?Baz:integer) is det.
+
+foobarbaz(_, 5) :- spam.
+
+spam :- foobarbaz(Bar, Baz)
+"
+ ))))
+
(ert-deftest complete-predicate ()
"Tests completing predicate calls."
(let ((temp (make-temp-file "sweeprolog-test"