Skip to content

attribute-style doc comments (#[doc]) are not shown in lsp-ui-sideline #3180

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

Closed
japaric opened this issue Feb 17, 2020 · 1 comment · Fixed by #4660
Closed

attribute-style doc comments (#[doc]) are not shown in lsp-ui-sideline #3180

japaric opened this issue Feb 17, 2020 · 1 comment · Fixed by #4660
Labels

Comments

@japaric
Copy link
Member

japaric commented Feb 17, 2020

Steps to reproduce

Start with cargo new --bin hello then modify src/main.rs to look like this:

/// Foo!
struct Foo;

#[doc = "Bar!"]
struct Bar;

fn main() {
    let _ = Foo;
    let _ = Bar;
}

Opening the file in emacs-nox and placing the cursor on Foo (line 8) shows:

struct Foo

Foo!

on the sideline.

Placing the cursor on Bar (line 9) only shows:

struct Bar

Pictures:

foo

bar

Meta

$ cd rust-analyzer
$ git rev-parse HEAD
32fc890de87e25c342b7c141ef98b07cb1471128

$ rustc -V
rustc 1.43.0-nightly (433aae93e 2020-02-14)

I have a crate that I machine generated using quote! and all generated doc comments use #[doc] attributes. The multi-line ones look like this:

#[doc = "one line description"]
#[doc = ""]
#[doc = "more detailed description"]
pub struct Foo;

None of them show up in lsp-ui-sideline

@matklad
Copy link
Member

matklad commented Feb 17, 2020

Should be fixed by #3182 "refactoring", but this would constitute a good test case!

bors bot added a commit that referenced this issue Jun 3, 2020
4660: Enable hover and autocomplete docs on macro generated items r=matklad a=aloucks

Enable hover and autocomplete docs on macro generated items. This de-sugars doc comments into `doc` attributes in some cases, but not all. Comments and `doc` attributes are then merged together. 

This PR is essentially a partial implementation of what's being suggested #3182, but it's not all the way there yet. ~I still need to add unit tests~, but I wanted to first get feedback on whether or not this was an acceptable path forward.

Fixes #4564
Fixes #3984
Fixes #3180
Related #3182

![macro_item_docs](https://user-images.githubusercontent.com/221559/83336760-15012200-a284-11ea-8d0d-b6a615850044.gif)



Co-authored-by: Aaron Loucks <[email protected]>
@bors bors bot closed this as completed in c6b739b Jun 3, 2020
lnicola pushed a commit to lnicola/rust-analyzer that referenced this issue Apr 7, 2024
…ure, r=RalfJung

Check that target features required by LLVM intrinsics are enabled

Fixes rust-lang/miri#3178
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this issue Apr 27, 2024
…ure, r=RalfJung

Check that target features required by LLVM intrinsics are enabled

Fixes rust-lang/miri#3178
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants