Skip to content

Resolve simple declarative macros in #[doc = ...] #15326

Closed
@not-my-profile

Description

@not-my-profile

A common use case would be #[doc = include_str!("../../README.md")]. Such include calls currently do not appear to be resolved by rust-analyzer (hovering over the identifier doesn't show the documentation from the README).

It would be great if rust-analyzer could additionally resolve simple custom declarative macros in #[doc = ...], e.g:

macro_rules! link {
    ($label:literal, $path:literal) => {
        concat!("[", $label, "](https://example.com/some/path", $path, ")")
    };
}

#[doc = link!("foo", "/bar.html")]
struct Foo;

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-featureCategory: feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions