Skip to content

Auto-imports broken in Emacs lsp-mode by commit 62d97d9 #18767

Closed
@traviscross

Description

@traviscross

The commit 62d97d9 ("Draft completion hashing") to rust-analyzer breaks the automatic adding of imports in Emacs + lsp-mode.

That commit, found via bisection, was part of this PR:

(Note that this is a second and seemingly-separate breakage from the earlier one that also affected Emacs + lsp-mode in #18653 and which was resolved in #18503.)

The behavior remains broken in the latest current commit to r-a (a77cf8e).

Others have also reported this breakage in #18363 (comment) (cc @xitep @monoid @noonebtw).

Testing procedure: Open a file in Emacs, start LSP, and type:

fn main() {
    let x: Pin// Wait, then select `% Pin Pin<{unknown}> (Struct)`.
}

At and after commit 62d97d9, this does not cause Pin to be imported, and the following error is logged (after typing "Pin" and before making a selection):

Error processing message (error "invalid type: null, expected a boolean").

This is testing with lsp-mode version 20241227.533 at commit emacs-lsp/lsp-mode@9de4050.

For details on how to set up an environment in a container suitable to reproduce this issue, see the instructions in #18504 (comment).

No assessment is being made in this report of whether r-a or lsp-mode is responsible, at a protocol level, for this regression.

Image

cc @Veykril @SomeoneToIgnore

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions