aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-11-11 09:00:27 +0000
committerGitHub <[email protected]>2019-11-11 09:00:27 +0000
commit2ccc45979cd2057bb88e209474698090fb32bb40 (patch)
treeb3cbebc3d63e1ab1af73cf17434809057a25ec6a /crates/ra_ide_api/src
parent113d7e44b7d4dee1be6a3d9fd8c724a3fff37b26 (diff)
parent5bb92c2d1af5f3045617a665d4e5c676700eb3c1 (diff)
Merge #2209
2209: impl fmt::Display for BuiltinType r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src')
-rw-r--r--crates/ra_ide_api/src/hover.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs
index 244c65814..cc41390b2 100644
--- a/crates/ra_ide_api/src/hover.rs
+++ b/crates/ra_ide_api/src/hover.rs
@@ -1,6 +1,6 @@
1//! FIXME: write short doc here 1//! FIXME: write short doc here
2 2
3use hir::{Adt, BuiltinType, HasSource, HirDisplay}; 3use hir::{Adt, HasSource, HirDisplay};
4use ra_db::SourceDatabase; 4use ra_db::SourceDatabase;
5use ra_syntax::{ 5use ra_syntax::{
6 algo::{ancestors_at_offset, find_covering_element, find_node_at_offset}, 6 algo::{ancestors_at_offset, find_covering_element, find_node_at_offset},
@@ -132,11 +132,7 @@ pub(crate) fn hover(db: &RootDatabase, position: FilePosition) -> Option<RangeIn
132 hir::ModuleDef::Static(it) => res.extend(from_def_source(db, it)), 132 hir::ModuleDef::Static(it) => res.extend(from_def_source(db, it)),
133 hir::ModuleDef::Trait(it) => res.extend(from_def_source(db, it)), 133 hir::ModuleDef::Trait(it) => res.extend(from_def_source(db, it)),
134 hir::ModuleDef::TypeAlias(it) => res.extend(from_def_source(db, it)), 134 hir::ModuleDef::TypeAlias(it) => res.extend(from_def_source(db, it)),
135 hir::ModuleDef::BuiltinType(it) => { 135 hir::ModuleDef::BuiltinType(it) => res.extend(Some(it.to_string())),
136 if let Some(b) = BuiltinType::ALL.iter().find(|(_, ty)| *ty == it) {
137 res.extend(Some(b.0.to_string()))
138 }
139 }
140 }, 136 },
141 Some(SelfType(ty)) => { 137 Some(SelfType(ty)) => {
142 if let Some((adt_def, _)) = ty.as_adt() { 138 if let Some((adt_def, _)) = ty.as_adt() {