abo-abo / swiper

Ivy - a generic completion frontend for Emacs, Swiper - isearch with an overview, and more. Oh, man!
https://oremacs.com/swiper/
2.31k stars 338 forks source link

No completions for package bazel.el in some cases #2872

Open phst opened 3 years ago

phst commented 3 years ago

Apologies for not providing a more minimal example, but I don't know enough about Ivy to make an informed guess where the problem lies.

To reproduce:

  1. clone https://github.com/bazelbuild/emacs-bazel-mode (current head at the point of writing is https://github.com/bazelbuild/emacs-bazel-mode/commit/56113b72d2016e9827e84a579abc700884590074)
  2. run make plain in the Swiper repository
  3. visit the file bazel.el in the cloned emacs-bazel-mode repository
  4. M-x eval-buffer
  5. M-x bazel-build
  6. Now there's a completion prompt. Enter //:, there will be no completions.
  7. C-g to cancel.
  8. Disable Ivy using M-x ivy-mode, repeat steps 5 and 6. After //: \<TAB>, some completions (e.g. bazel, bazel_test) should show up. These are missing from the Ivy prompt (step 6).

The bug might very well be in bazel.el, but since this works with plain Emacs, I'd hope it should work with Ivy as well.

This is with Emacs 27.2.

basil-conto commented 3 years ago

The bug might very well be in bazel.el, but since this works with plain Emacs, I'd hope it should work with Ivy as well.

I'd hope so too, but sadly programmed completion is not a first class citizen in Ivy. :( Instead, Ivy defines its own custom flavour of programmed completion in the form of :dynamic-collection; see e.g. (info "(ivy) Example - counsel-locate").

So at first glance this looks to me like the same well-known limitation as in #1597.

It is not at all obvious to me how to go about supporting programmed completion with Ivy's current design. Maybe @abo-abo will have an idea.