Skip to content

simple-completions now completes package names as well #575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
12 changes: 11 additions & 1 deletion slynk/slynk-completion.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,21 @@
(t (guess-package pname))))
(test (lambda (sym) (prefix-match-p name (symbol-name sym))))
(syms (and pkg (matching-symbols pkg extern test)))
;; get the names of all matching packages
(package-strings
(unless pname
(sort (loop for p in (list-all-packages)
;; Append ":" to distinguish it as a package completion.
for str = (concatenate 'string (unparse-symbol (make-symbol (package-name p))) ":")
when (prefix-match-p name str)
collect str)
#'string>)))
(strings (loop for sym in syms
for str = (unparse-symbol sym)
when (prefix-match-p name str) ; remove |Foo|
collect str)))
(format-completion-set strings intern pname))))
;; Package completions should come first
(concatenate 'list package-strings (format-completion-set strings intern pname)))))

(defun matching-symbols (package external test)
(let ((test (if external
Expand Down