Skip to content
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

Shadows annotation function for backends that don't use metadata #30

Open
mohkale opened this issue Apr 15, 2024 · 0 comments · May be fixed by #31
Open

Shadows annotation function for backends that don't use metadata #30

mohkale opened this issue Apr 15, 2024 · 0 comments · May be fixed by #31

Comments

@mohkale
Copy link

mohkale commented Apr 15, 2024

Issue Description

Hi there,

Recently I discovered vertico actually renders annotation function content in the completion-at-point overlay provided by consult, like so:

Screenshot_20240415_211310

However this doesn't work for eglot as a completion backend which is surprising.

Screenshot_20240415_211357

After some back and forth I managed to track down this package as the cause 😞. After disabling it eglot annotations do show up in the vertico overlay.

Screenshot_20240415_211322

Reproduction Instructions

  1. Bring up a emacs -q instance and run the following.
(progn
  (setq package-archives
        '(("MELPA" . "https://melpa.org/packages/")
          ("gnu" . "http://elpa.gnu.org/packages/")))
  (package-refresh-contents)
  (use-package eglot
    :demand t)
  (use-package all-the-icons-completion
    :ensure t
    :hook (marginalia-mode . all-the-icons-completion-marginalia-setup))
  (use-package marginalia
    :ensure t
    :hook (vertico-mode . marginalia-mode))
  (use-package vertico
    :demand t
    :ensure t
    :config
    (vertico-mode))
  (use-package consult
    :ensure t
    :demand t
    :config
    (setq completion-in-region-function #'consult-completion-in-region)))
  1. Find a C++ project and enable eglot in it. here's an example project.
  2. Open a CPP file and try inserting something.
  3. Run M-x completion-at-point and get completions without annotations.
  4. Run M-x all-the-icons-completion-mode to disable this package.
  5. Run M-x completion-at-point and get completions with annotations.

Cause of Bug

Seems to be because eglots capf doesn't set an annotation function, it sets a :annotation-function property in the capf which consult re-exports in completion-extra-properties but this package ignores and then sets a annotation function just to set an icon and thus overrides.

@mohkale mohkale changed the title Shadows annotation function for unregistered marginalia categories Shadows annotation function for backends that don't use metadata Apr 15, 2024
mohkale added a commit to mohkale/all-the-icons-completion that referenced this issue Apr 15, 2024
@mohkale mohkale linked a pull request Apr 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant