Skip to content

Render more relevant documentation on hover assertions of #4957

@matiascr

Description

@matiascr

In assertions:

/// Case variants docs
pub type CaseVariant(generic_if_any) {
  Variant1
  Variant2(generic_if_any)
  /// Variant 3 docs
  Variant3(number: Int)
}

fn f(cv) {
  let assert Variant3(number: _) = cv
  cv.number
}

In the second line, the LS knows enough to tell that cv after the assert is a Variant3 and suggests the number field on completion. However, hovering over Variant3 or cv, the documentation provided now is CaseVariant(generic_if_any).
My suggestion would be to return the documentation as

CaseVariant.Variant3(number: String)

Variant 3 docs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions