Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions monroe.el
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,9 @@ inside a container.")
(goto-char (point-min))
(forward-line (1- line)))))))))

(defun monroe-completion-candidate (completions)
(monroe-dbind-response completions (candidate) candidate))

(defun monroe-completion-at-point ()
"Function to be used for the hook 'completion-at-point-functions'."
(interactive)
Expand All @@ -524,11 +527,13 @@ inside a container.")
(ns (monroe-get-clojure-ns))
(sym (thing-at-point 'symbol))
(response (monroe-send-sync-request (list "op" "completions"
"ns" ns
"ns" (or ns "user")
"session" (monroe-current-session)
"prefix" sym))))
(monroe-dbind-response response (completions)
(when completions
(list start end (mapcar 'cdadr completions) nil)))))
(let ((candidates (mapcar 'monroe-completion-candidate completions)))
(list start end candidates nil))))))

(defun monroe-get-stacktrace ()
"When error happens, print the stack trace"
Expand Down Expand Up @@ -667,7 +672,7 @@ The following keys are available in `monroe-mode':
(setq comint-input-sender 'monroe-input-sender)
(setq mode-line-process '(":%s"))
;(set (make-local-variable 'font-lock-defaults) '(clojure-font-lock-keywords t))
(add-hook 'completion-at-point-functions #'monroe-completion-at-point 'local)
(add-hook 'completion-at-point-functions #'monroe-completion-at-point nil 'local)
;; a hack to keep comint happy
(unless (comint-check-proc (current-buffer))
(let ((fake-proc (start-process "monroe" (current-buffer) nil)))
Expand Down