Skip to content

Doc/Attribute range mapping is broken with inner file docs + outer impl docs #8847

@Veykril

Description

@Veykril

Pasting the following snippet in a file causes the highlighting to break

//! This is a module to test doc injection.
//! ```
//! fn test() {}
//! ```

/// This is an impl with a code block.
///
/// ```
/// fn foo() {
///
/// }
/// ```
impl () {}

image

This only seems to happen for when the annotated item is an impl, another requirement is that number of lines of doc comments on the impl have to be at least 3 more than the inner doc comments. This also breaks hovering on intra doc links so this seems to be a problem with the source mapping?

This impl stuff seems so oddly specific ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Broken WindowBugs / technical debt to be addressed immediatelyS-actionableSomeone could pick this issue up and work on it right now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions