[slime-devel] Strange scores in slime-fuzzy-completion / feature request.

Stas Boukarev stassats at gmail.com
Fri Aug 10 10:00:42 UTC 2012


pjb at informatimago.com (Pascal J. Bourguignon) writes:

> In a new lisp file type:
>
> (defpackage :slime-fuzzy-misfeature
>   (:use :cl))
> (in-package :slime-fuzzy-misfeature)
>
> (defun f ()
>   (let ((pos 4)
>         (siz 2))
>     (+ pos siz)))
>
> (defstruct pt h v)
>
> (defun g (p)
>   (let ((pos-h (pt-h p))
>         (pos-v (pt-v p)))
>     (+ )))
>
> C-x C-s C-c C-l
>
> Then move after the + in g, and type po M-TAB  We get these fuzzy
> completion choices:
>
> For help on how the use this buffer, see `slime-fuzzy-completions-mode'.
>
> Flags: boundp fboundp generic-function class macro special-operator package
>
> Completion:                                                 Flags:   Score:
> ----------------------------------------------------------- -------- --------
> pop                                                         -f---m-- 24.70
> pos                                                         -------- 24.70
> pos-h                                                       -------- 22.20
> pos-v                                                       -------- 22.20
> position                                                    -f------ 21.13
> position-if                                                 -f------ 20.70
> position-if-not                                             -f------ 20.41
>>
>
> 1- pop is bound to a function not a variable, we're completing a
>    variable: it should not be proposed at all!
>
> 2- pos is not in scope it should not be proposed at all.
>
> In general it looks like shorter symbols are proposed with higher
> scores.  Instead, symbols in scope (taking account namespaces) should
> have higher scores.
fuzzy-completion doesn't have any context-awareness and distinguishing
between variables and functions is not easy. So, don't hold your breath
waiting for this feature to be implemented.

-- 
With best regards, Stas.




More information about the slime-devel mailing list