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

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

[nongnu] elpa/idris-mode a51508f 1/2: [ feature ] make completion via co


From: ELPA Syncer
Subject: [nongnu] elpa/idris-mode a51508f 1/2: [ feature ] make completion via compiler optional.
Date: Wed, 3 Nov 2021 09:57:48 -0400 (EDT)

branch: elpa/idris-mode
commit a51508f6b3cd5cd0093b5f4364be05d3fb1239c7
Author: Jan de Muijnck-Hughes <jan.deMuijnck-Hughes@glasgow.ac.uk>
Commit: Jan de Muijnck-Hughes <jan.deMuijnck-Hughes@glasgow.ac.uk>

    [ feature ] make completion via compiler optional.
---
 idris-commands.el | 17 +++++++++--------
 idris-repl.el     | 13 +++++++------
 idris-settings.el |  5 +++++
 3 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/idris-commands.el b/idris-commands.el
index 42bfe32..f7cb915 100644
--- a/idris-commands.el
+++ b/idris-commands.el
@@ -885,14 +885,15 @@ already loaded, as a buffer awaiting completion is 
probably not
 type-correct, so loading will fail."
   (if (not idris-process)
       nil
-    (cl-destructuring-bind (identifier start end) 
(idris-identifier-backwards-from-point)
-      (when identifier
-        (let ((result (car (idris-eval `(:repl-completions ,identifier)))))
-          (cl-destructuring-bind (completions _partial) result
-            (if (null completions)
-                nil
-              (list start end completions
-                    :exclusive 'no))))))))
+    (when idris-completion-via-compiler
+      (cl-destructuring-bind (identifier start end) 
(idris-identifier-backwards-from-point)
+        (when identifier
+          (let ((result (car (idris-eval `(:repl-completions ,identifier)))))
+            (cl-destructuring-bind (completions _partial) result
+              (if (null completions)
+                  nil
+                (list start end completions
+                      :exclusive 'no)))))))))
 
 (defun idris-complete-keyword-at-point ()
   "Attempt to complete the symbol at point as an Idris keyword."
diff --git a/idris-repl.el b/idris-repl.el
index 75d138d..38bbd94 100644
--- a/idris-repl.el
+++ b/idris-repl.el
@@ -282,12 +282,13 @@ Invokes `idris-repl-mode-hook'."
 
 (defun idris-repl-complete ()
   "Completion of the current input"
-  (let* ((input (idris-repl-current-input))
-         (result (idris-eval `(:repl-completions ,input))))
-    (cl-destructuring-bind (completions partial) (car result)
-      (if (null completions)
-          nil
-        (list (+ idris-input-start (length partial)) (point-max) 
completions)))))
+  (when idris-completion-via-compiler
+    (let* ((input (idris-repl-current-input))
+           (result (idris-eval `(:repl-completions ,input))))
+      (cl-destructuring-bind (completions partial) (car result)
+        (if (null completions)
+            nil
+          (list (+ idris-input-start (length partial)) (point-max) 
completions))))))
 
 (defun find-common-prefix (input slist)
   "Finds longest common prefix of all strings in list."
diff --git a/idris-settings.el b/idris-settings.el
index aa94af2..4045178 100644
--- a/idris-settings.el
+++ b/idris-settings.el
@@ -79,6 +79,11 @@ The log is placed in `idris-event-buffer-name'."
   :group 'idris
   :type 'boolean)
 
+(defcustom idris-completion-via-compiler t
+  "Use the compiler to make suggestions."
+  :type 'boolean
+  :group 'idris)
+
 ;;; Faces
 (defface idris-active-term-face
   '((((background light))



reply via email to

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