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

ra have trouble to expand procedural macro of the xflags crate when doc comment is used #17137

Closed
nerditation opened this issue Apr 25, 2024 · 1 comment
Labels
C-bug Category: bug

Comments

@nerditation
Copy link

rust-analyzer version:

rust-analyzer version: 0.4.1935-standalone (73a4275 2024-04-24)

rustc version:

rustc 1.79.0-nightly (ccfcd950b 2024-04-15)

editor or extension:

vscode extension version: 0.4.1935 (pre-release)

relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME)
none

code snippet to reproduce:

// cargo add xflags@0.3.2
xflags::xflags! {
    /// doc comment lines cause problems
    cmd example {
    }
}
fn main() {
    let _cli = Example::from_env_or_exit();
}

some notes:

  • the code is perfectly good;

    • can run cargo build and cargo run
    • also cargo expand shows correct output
  • vscode command "expand macro recursively at caret" output is EMPTY;

  • ra doesn't seem to report any errors, as far as I can see, even with RA_LOG = info

  • the macro generated types won't appear in code completion candidate list;

  • removing doc comment lines "fixes" the problem;

  • changing doc comment lines into equivalent #[doc = "..."] attributes also "fixes" the problem,

    • e.g. ra can expand and parse this code without any problem:
    xflags::xflags! {
        #[doc ="this has no problem at all"]
        cmd example {
        }
    }
@nerditation nerditation added the C-bug Category: bug label Apr 25, 2024
@Veykril
Copy link
Member

Veykril commented Apr 26, 2024

Duplicate of #16259

@Veykril Veykril marked this as a duplicate of #16259 Apr 26, 2024
@Veykril Veykril closed this as completed Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants