rust-analyzer: `!!MISSING: command!!` above enums/structs after opening VS Code

Every time I open VS Code, where a Rust project is opened, the text !!MISSING: command!! appears above every struct and enum, where the number of implementations should be:

Bug screenshot

The bug doesn’t disappear until I close the file and re-open it.

EDIT: This text only appears in one project, which uses LALRPOP. In my other projects, no text is displayed. The number of implementations only appears after closing and re-opening the file.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 15 (7 by maintainers)

Commits related to this issue

Most upvoted comments

Yup, this should be fixed in #8015. Instead of erroring these lenses shouldn’t appear at all now, as there is no HIR for the files when this happened.

I can confirm that it’s intermittent. In a different project, I get the error in one file but not in another in the same module.

Update: a clue! This has something to do with module import resolution. If, for example I write a struct in a .rs file within a some_module module folder, but haven’t yet declared that module in the some_module.rs or lib.rs, the !!MISSING_COMMAND!! error appears.

However, upon declaring

mod some_module.rs;

in the appropriate location, the error instantly disappears and I see the expected n implementations message.

Reappearing on nightly

Using "rust-analyzer.updates.channel": "nightly" in my vscode config