Skip to content

lsp-headerline doesn't update breadcrumb when previewing with consult-xref--preview #4802

Open
@dhashe

Description

@dhashe

Thank you for the bug report

  • I am using the latest version of lsp-mode related packages.
  • I checked FAQ and Troubleshooting sections
  • You may also try reproduce the issue using clean environment using the following command: M-x lsp-start-plain

Bug description

When previewing results with consult-xref with lsp-headerline-breadcrumb-mode enabled, the breadcrumb doesn't update to match the previewed buffer as you scroll through the results.

Consult provides 'consult-after-jump-hook for this. We already have similar handling for 'xref-after-jump-hook and can just copy the same logic for consult.

Steps to reproduce

;; Ensure that consult is loaded.
(require 'consult)

;; Ensure that xref-show-xrefs-function is bound to consult-xref.
(setq xref-show-xrefs-function #'consult-xref)

;; Ensure that lsp-headerline-breadcrumb-mode is enabled
(lsp-headerline-breadcrumb-mode)

;; Place point over a symbol and invoke lsp-find-references
(lsp-find-references)

See gif showing current behavior.

Image

Expected behavior

See gif showing expected behavior (using changes that I have made locally).

Image

Which Language Server did you use?

Not applicable to this issue, but C++ with clangd.

OS

Linux

Error callstack

Anything else?

I plan to put up a PR with a fix soon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions