Skip to content

Commit 32f93c7

Browse files
committed
Define internal completion functions
1 parent 999164c commit 32f93c7

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

haskell-completions.el

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
;;; Code:
3838

3939
(require 'haskell-mode)
40+
(require 'haskell-process)
41+
(require 'haskell-interactive-mode)
4042

4143
(defvar haskell-completions-pragma-names
4244
(list "DEPRECATED"
@@ -218,6 +220,22 @@ result only if prefix length is not less than MINLEN."
218220
prefix))
219221
(prefix prefix)))))
220222

223+
(defun haskell-completions-sync-complete-repl (prefix &optional import)
224+
"Return completion list for given PREFIX quering REPL synchronously.
225+
When optional IMPORT argument is non-nil complete PREFIX
226+
prepending \"import \" keyword (useful for module names). This
227+
function is supposed for internal use."
228+
(haskell-process-get-repl-completions
229+
(haskell-interactive-process)
230+
(if import
231+
(concat "import " prefix)
232+
prefix)))
233+
234+
(defun haskell-completions-dabbrev-completions (prefix)
235+
"Return completion list for PREFIX using dabbrev facility.
236+
This function is supposed for internal use."
237+
(dabbrev--reset-global-variables)
238+
(dabbrev--find-all-expansions prefix nil))
221239

222240
(provide 'haskell-completions)
223241
;;; haskell-completions.el ends here

0 commit comments

Comments
 (0)