Struct ra_ap_ide_assists::Assist
source · [−]pub struct Assist {
pub id: AssistId,
pub label: Label,
pub group: Option<GroupLabel>,
pub target: TextRange,
pub source_change: Option<SourceChange>,
}
Fields
id: AssistId
label: Label
Short description of the assist, as shown in the UI.
group: Option<GroupLabel>
target: TextRange
Target ranges are used to sort assists: the smaller the target range, the more specific assist is, and so it should be sorted first.
source_change: Option<SourceChange>
Computing source change sometimes is much more costly then computing the other fields. Additionally, the actual change is not required to show the lightbulb UI, it only is needed when the user tries to apply an assist. So, we compute it lazily: the API allow requesting assists with or without source change. We could (and in fact, used to) distinguish between resolved and unresolved assists at the type level, but this is cumbersome, especially if you want to embed an assist into another data structure, such as a diagnostic.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Assist
impl UnwindSafe for Assist
Blanket Implementations
Mutably borrows from an owned value. Read more
fn cast<U>(self, interner: <U as HasInterner>::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
fn cast<U>(self, interner: <U as HasInterner>::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
Cast a value to type U
using CastTo
.
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more