Skip to content

if a package becomes a lib+bin package mid-edit, ra requires a restart to notice #19849

Open
@lolbinarycat

Description

@lolbinarycat

rust-analyzer version: rust-analyzer 1.86.0 (05f9846 2025-03-31)

rustc version: rustc 1.86.0 (05f9846f8 2025-03-31)

editor or extension: emacs eglot

relevant settings: eglot-ensure in rust-mode-hook

reproduction steps

  1. cargo init --lib
  2. open the newly created src/lib.rs in editor
  3. open (nonexistent) src/main.rs in editor, add fn main() {}, save file
  4. you will still be getting an unlined-file error and all LSP features will not work except highlighting error/warning lines

workaround: restart rust-analyzer (in emacs this can be done with M-x eglot)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @lolbinarycat

        Issue actions

          if a package becomes a lib+bin package mid-edit, ra requires a restart to notice · Issue #19849 · rust-lang/rust-analyzer