From 09d86f7a99b81cd9cce07bd74bc31175ecfc085c Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Sat, 18 Jul 2026 22:18:09 +0200 Subject: [PATCH] ellie-complete: use /complete endpoint via 9p rdwr --- ellie.el | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/ellie.el b/ellie.el index d678430..1b89a52 100644 --- a/ellie.el +++ b/ellie.el @@ -699,24 +699,26 @@ Calling again while a suggestion is showing requests a new one." (cur-point (point)) (region-cons (and has-region (cons reg-beg reg-end))) (buf (current-buffer)) - (ucomplete (expand-file-name "u/complete" ellie-mount-directory))) + (complete-path (concat (file-name-as-directory + (or (getenv "NAMESPACE") + (expand-file-name "ns" (or (getenv "TMPDIR") "/tmp")))) + "ollie/complete"))) (when has-region (deactivate-mark)) (message "ellie: completing...") - (let* ((process-environment - (append (list (concat "OLLIE=" ellie-mount-directory)) - process-environment)) - (cmd (format "%s -file %s -suffix %s -model %s -backend %s" - (shell-quote-argument ucomplete) - (shell-quote-argument (file-name-nondirectory filename)) - (shell-quote-argument suffix) - (shell-quote-argument ellie-complete-model) - (shell-quote-argument ellie-complete-backend))) + (let* ((json-payload (json-encode + `((cwd . ,(expand-file-name default-directory)) + (file . ,(file-name-nondirectory filename)) + (prefix . ,prefix) + (suffix . ,suffix) + (context . "")))) (proc-buf (generate-new-buffer " *ellie-complete*"))) (when ellie--complete-timer (cancel-timer ellie--complete-timer)) (set-process-sentinel - (start-process-shell-command "ellie-complete" proc-buf - (format "printf '%%s' %s | %s" - (shell-quote-argument prefix) cmd)) + (start-process-shell-command + "ellie-complete" proc-buf + (format "printf '%%s' %s | 9p rdwr %s" + (shell-quote-argument json-payload) + (shell-quote-argument complete-path))) (lambda (proc _event) (when (eq (process-status proc) 'exit) (let ((result (string-trim-right @@ -728,7 +730,7 @@ Calling again while a suggestion is showing requests a new one." (string-empty-p (string-trim result))) (message "ellie: empty completion") (ellie--ghost-show result cur-point buf region-cons) - (message "ellie: TAB/RET accept · M-/ retry · any key dismiss")))))))))) + (message "ellie: TAB/RET accept · M-/ retry · any key dismiss"))))))))))) ;;;###autoload (define-key global-map (kbd "M-/") #'ellie-complete)