The test-completion case shouldn't return t when there are multiple
matches. Similarly, the try-completion should return t only if the
match is exact. See (info "(elisp)Programmed Completion").
* eglot.el (eglot-completion-at-point): Instead of testing
memberships, use test-completion and try-completion suggested
by (info "(elisp)Programmed Completion").
* eglot-tests.el (non-unique-completions): Add new test.
Co-authored-by: João Távora <joaotavora@gmail.com>
GitHub-reference: fix https://github.com/joaotavora/eglot/issues/365
(cond
((eq action 'metadata) metadata) ; metadata
((eq action 'lambda) ; test-completion
- (member probe (funcall proxies)))
+ (test-completion probe (funcall proxies)))
((eq (car-safe action) 'boundaries) nil) ; boundaries
- ((and (null action) ; try-completion
- (member probe (funcall proxies)) t))
+ ((null action) ; try-completion
+ (try-completion probe (funcall proxies)))
((eq action t) ; all-completions
(cl-remove-if-not
(lambda (proxy)