emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/sweeprolog 6e3bf5c996 5/6: Add test for predicate completi


From: ELPA Syncer
Subject: [nongnu] elpa/sweeprolog 6e3bf5c996 5/6: Add test for predicate completion with named arguments
Date: Sun, 27 Nov 2022 14:59:31 -0500 (EST)

branch: elpa/sweeprolog
commit 6e3bf5c9965b34115f23e3578abd7a81df324e67
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>

    Add test for predicate completion with named arguments
---
 README.org          |  5 -----
 sweeprolog-tests.el | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/README.org b/README.org
index 244528fb74..a289c99ce6 100644
--- a/README.org
+++ b/README.org
@@ -1648,11 +1648,6 @@ there some further improvements that we want to pursue:
   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
diff --git a/sweeprolog-tests.el b/sweeprolog-tests.el
index 183068134c..873209840e 100644
--- a/sweeprolog-tests.el
+++ b/sweeprolog-tests.el
@@ -262,6 +262,38 @@ foo => barbaz(_, _)"
 
                      ))))
 
+(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"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]