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

Missing hover docs on primitive methods #7688

Open
deltaphc opened this issue Feb 15, 2021 · 4 comments
Open

Missing hover docs on primitive methods #7688

deltaphc opened this issue Feb 15, 2021 · 4 comments
Labels
A-hover hover feature A-macro macro expansion C-bug Category: bug S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work.

Comments

@deltaphc
Copy link

rust-analyzer-no-primmethdocs

Running the 2021.2.15 release.

It correctly provides completions for primitive types, but doesn't show their documentation. Not that big of a deal, but I figured I'd report it anyway since it doesn't appear to be an existing issue.

@flodiebold flodiebold added A-macro macro expansion S-actionable Someone could pick this issue up and work on it right now and removed A-macro macro expansion labels Feb 15, 2021
@Veykril
Copy link
Member

Veykril commented Feb 17, 2021

This only happens for uint_impl! generated functions in std, expanding the macro invocation reveals that the expansion breaks docs/attributes I think? https://gist.github.com/Veykril/9f64c18c98553523fc0f9e8bb6c7721d
I think our expansion doesn't handle mixed doc-strings and doc attributes that well.

@Veykril Veykril added the A-macro macro expansion label Feb 17, 2021
@edwin0cheng
Copy link
Member

It seem like related to #7423.

@edwin0cheng
Copy link
Member

edwin0cheng commented Mar 18, 2021

TIL : the problem here is quite interesting , MWE :

macro_rules! doc_comment {
    ($x:expr, $($tt:tt)*) => {
        #[doc = $x]
        $($tt)*
    };
}

doc_comment! { 
    concat!("Hello"," world"),
    struct Bar;
}

And of course we don't handle this case, because it will be expanded to :

#[doc = concat!("Hello", " world")]
struct Bar;

And the interesting point is, the above expanded code is unstable in rustc too. But the macro one is stable.

[Edit]

Add #8092 for tracking the actual problem.

@lnicola lnicola added S-unactionable Issue requires feedback, design decisions or is blocked on other work and removed S-actionable Someone could pick this issue up and work on it right now labels Mar 19, 2021
@edwin0cheng
Copy link
Member

After #8550, a half of documentation is shown. 😆

To fix this, #8092 is still needed.

bug

@Veykril Veykril added A-hover hover feature S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work. and removed S-unactionable Issue requires feedback, design decisions or is blocked on other work labels Jan 19, 2023
@Veykril Veykril added the C-bug Category: bug label Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-hover hover feature A-macro macro expansion C-bug Category: bug S-blocked Status: marked as blocked ❌ on something else such as an RFC or other implementation work.
Projects
None yet
Development

No branches or pull requests

5 participants