Fix hover for Self
keyword
This commit is contained in:
parent
5c0aee013e
commit
b454f11f38
@ -302,6 +302,7 @@ fn pretty_print_macro_expansion(expn: SyntaxNode, map: Option<&TokenMap>) -> Str
|
|||||||
(T![fn], T!['(']) => "",
|
(T![fn], T!['(']) => "",
|
||||||
(T![']'], _) if curr_kind.is_keyword() => " ",
|
(T![']'], _) if curr_kind.is_keyword() => " ",
|
||||||
(T![']'], T![#]) => "\n",
|
(T![']'], T![#]) => "\n",
|
||||||
|
(T![Self], T![::]) => "",
|
||||||
_ if prev_kind.is_keyword() => " ",
|
_ if prev_kind.is_keyword() => " ",
|
||||||
_ => "",
|
_ => "",
|
||||||
};
|
};
|
||||||
|
@ -545,7 +545,6 @@ fn keyword_hints(
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
T![fn] => {
|
T![fn] => {
|
||||||
let module = match ast::FnPtrType::cast(parent) {
|
let module = match ast::FnPtrType::cast(parent) {
|
||||||
// treat fn keyword inside function pointer type as primitive
|
// treat fn keyword inside function pointer type as primitive
|
||||||
@ -554,7 +553,7 @@ fn keyword_hints(
|
|||||||
};
|
};
|
||||||
KeywordHint::new(token.text().to_string(), module)
|
KeywordHint::new(token.text().to_string(), module)
|
||||||
}
|
}
|
||||||
|
T![Self] => KeywordHint::new(token.text().to_string(), "self_upper_keyword".into()),
|
||||||
_ => KeywordHint::new(token.text().to_string(), format!("{}_keyword", token.text())),
|
_ => KeywordHint::new(token.text().to_string(), format!("{}_keyword", token.text())),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user