[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"
- [nongnu] elpa/sweeprolog updated (ad74fa17bb -> f4e9d872c8), ELPA Syncer, 2022/11/27
- [nongnu] elpa/sweeprolog caef2e51dc 1/6: * README.org ("Things To Do"): remove outdated item, ELPA Syncer, 2022/11/27
- [nongnu] elpa/sweeprolog 6e3bf5c996 5/6: Add test for predicate completion with named arguments,
ELPA Syncer <=
- [nongnu] elpa/sweeprolog 94dc85fb0f 2/6: Add repeat keymap for sweeprolog-forward-hole, ELPA Syncer, 2022/11/27
- [nongnu] elpa/sweeprolog 33323c7586 4/6: ENHANCED: use argument names for holes in predicate completion, ELPA Syncer, 2022/11/27
- [nongnu] elpa/sweeprolog 4b494f9c90 3/6: * (sweeprolog-analyze-fragment-flymake): fix typo, ELPA Syncer, 2022/11/27
- [nongnu] elpa/sweeprolog f4e9d872c8 6/6: Announce recent changes in NEWS.org and bump version to 0.9.3, ELPA Syncer, 2022/11/27