mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-30 03:27:44 +00:00
Fix completion in when typing integer.|
It should show integer, not floating point methods.
This commit is contained in:
parent
11c7207aa5
commit
0b6df1716d
3 changed files with 50 additions and 1 deletions
|
|
@ -3043,10 +3043,17 @@ pub struct BuiltinType {
|
|||
}
|
||||
|
||||
impl BuiltinType {
|
||||
// Constructors are added on demand, feel free to add more.
|
||||
pub fn str() -> BuiltinType {
|
||||
BuiltinType { inner: hir_def::builtin_type::BuiltinType::Str }
|
||||
}
|
||||
|
||||
pub fn i32() -> BuiltinType {
|
||||
BuiltinType {
|
||||
inner: hir_def::builtin_type::BuiltinType::Int(hir_ty::primitive::BuiltinInt::I32),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn ty<'db>(self, db: &'db dyn HirDatabase) -> Type<'db> {
|
||||
let core = Crate::core(db).map(|core| core.id).unwrap_or_else(|| db.all_crates()[0]);
|
||||
Type::new_for_crate(core, TyBuilder::builtin(self.inner))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue