Fix hover for Self keyword

This commit is contained in:
Lukas Wirth 2022-03-05 23:47:44 +01:00
parent 5c0aee013e
commit b454f11f38
2 changed files with 2 additions and 2 deletions

View File

@ -302,6 +302,7 @@ fn pretty_print_macro_expansion(expn: SyntaxNode, map: Option<&TokenMap>) -> Str
(T![fn], T!['(']) => "",
(T![']'], _) if curr_kind.is_keyword() => " ",
(T![']'], T![#]) => "\n",
(T![Self], T![::]) => "",
_ if prev_kind.is_keyword() => " ",
_ => "",
};

View File

@ -545,7 +545,6 @@ fn keyword_hints(
},
}
}
T![fn] => {
let module = match ast::FnPtrType::cast(parent) {
// treat fn keyword inside function pointer type as primitive
@ -554,7 +553,7 @@ fn keyword_hints(
};
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())),
}
}