## Next
+* Candidates from grouped back-ends are retrieved more accurately: each
+ `candidates` command receives in the second argument the respective value the
+ back-end returned to the `prefix` command.
* `company-auto-complete` is disabled by default.
* `company-auto-complete-chars` default value includes fewer syntax classes.
* In expanded function calls, arguments skipped by the user default to "argN".
(should (null company-candidates))
(should (null (company-explicit-action-p))))))
+(ert-deftest company-multi-backend-adapter-uses-respective-prefixes ()
+ ;; And ignores the second argument.
+ (let ((company-backend
+ (list (lambda (command &optional arg)
+ (case command
+ (prefix "bar")
+ (candidates (mapcar (lambda (tail) (concat arg "-" tail))
+ '("a" "b" "c")))))
+ (lambda (command &optional arg)
+ (case command
+ (prefix "foo-bar")
+ (candidates (mapcar (lambda (tail) (concat arg "-" tail))
+ '("d" "e"))))))))
+ (should (equal (sort '("bar-a" "bar-b" "bar-c" "foo-bar-d" "foo-bar-e")
+ 'string<)
+ (company-call-backend 'candidates "hubba-hubba")))))
+
+;; Pseudo-Tooltip
+
(ert-deftest company-pseudo-tooltip-does-not-get-displaced ()
(with-temp-buffer
(save-window-excursion
(case command
(candidates
(loop for backend in backends
- when (equal (funcall backend 'prefix)
- (car args))
- append (apply backend 'candidates args)))
+ for prefix = (funcall backend 'prefix)
+ when prefix
+ append (funcall backend 'candidates prefix)))
(sorted nil)
(duplicates t)
(otherwise