~eshel/sweep

21e20f8fa85dd6c3efe43274b080d353b219e477 — Eshel Yaron 6 months ago 349a7a1 + 168e6f0
Merge branch 'master'
4 files changed, 24 insertions(+), 11 deletions(-)

M sweep.pl
M sweep.texi
M sweeprolog-tests.el
M sweeprolog.el
M sweep.pl => sweep.pl +4 -1
@@ 436,7 436,10 @@ explicit_args_(0, G, G) :-
    atom(G),
    !.
explicit_args_(N, G0, G) :-
    compound_name_arguments(G0, F, A0),
    (   atom(G0)
    ->  F = G0, A0 = []
    ;   compound_name_arguments(G0, F, A0)
    ),
    length(A1, N),
    append(A0, A1, A),
    compound_name_arguments(G, F, A).

M sweep.texi => sweep.texi +3 -2
@@ 3538,8 3538,9 @@ takes into account Prolog-specific conventions.
@item Facilitate interactive debugging
Sweep should facilitate interactive debugging of SWI-Prolog code.
This is a big topic that we don't clearly address.  Perhaps this
should handled through a Debug Adapter Protocol integration similar to
@code{dap-swi-prolog} (@uref{https://github.com/eshelyaron/debug_adapter/blob/main/README.md,
should be handled through a Debug Adapter Protocol integration similar
to @code{dap-swi-prolog}
(@uref{https://github.com/eshelyaron/debug_adapter/blob/main/README.md,
Debug Adapter Protocol for SWI-Prolog}).

@item Integrate with @file{project.el} adding support for SWI-Prolog packs

M sweeprolog-tests.el => sweeprolog-tests.el +15 -0
@@ 2412,4 2412,19 @@ foo(Bar) --> baz(Bar).
    Doit.
" (cons 4 15)))))

(sweeprolog-deftest eldoc-dcg-atom ()
  "Test `sweep_short_documentation/2' with atom non-terminals."
  "
:- module(eldocdcgatom, []).

:- use_module(library(dcg/basics)).
"
  (should (equal (sweeprolog--query-once
                  "sweep" "sweep_short_documentation"
                  (list "bar --> blanks." 9 (buffer-file-name)))
                 (list "dcg_basics:blanks//0" "blanks// is det.
    Skip zero or more white-space characters.
" nil))))


;;; sweeprolog-tests.el ends here

M sweeprolog.el => sweeprolog.el +2 -8
@@ 624,10 624,6 @@ By default, this is t on systems where Emacs can use a pty."

(defvar-local sweeprolog--diagnostics-report-fn nil)

(defvar-local sweeprolog--diagnostics-changes-beg nil)

(defvar-local sweeprolog--diagnostics-changes-end nil)

(defvar-local sweeprolog--timer nil)

(defvar-local sweeprolog--analyze-buffer-duration 0.2)


@@ 3388,11 3384,9 @@ variable at point, if any."

;;;; Flymake

(defun sweeprolog-diagnostic-function (report-fn &rest rest)
(defun sweeprolog-diagnostic-function (report-fn &rest _)
  (setq sweeprolog--diagnostics nil
        sweeprolog--diagnostics-report-fn report-fn
        sweeprolog--diagnostics-changes-beg (plist-get rest :changes-start)
        sweeprolog--diagnostics-changes-end (plist-get rest :changes-end)))
        sweeprolog--diagnostics-report-fn report-fn))

(defun sweeprolog-show-diagnostics (&optional proj)
  "Show diagnostics for the current project, or buffer if PROJ is nil.