aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src')
-rw-r--r--crates/ra_ide/src/display/navigation_target.rs2
-rw-r--r--crates/ra_ide/src/goto_definition.rs2
-rw-r--r--crates/ra_ide/src/hover.rs2
-rw-r--r--crates/ra_ide/src/references.rs2
-rw-r--r--crates/ra_ide/src/references/classify.rs8
-rw-r--r--crates/ra_ide/src/references/name_definition.rs6
-rw-r--r--crates/ra_ide/src/snapshots/rainbow_highlighting.html1
-rw-r--r--crates/ra_ide/src/syntax_highlighting.rs3
8 files changed, 13 insertions, 13 deletions
diff --git a/crates/ra_ide/src/display/navigation_target.rs b/crates/ra_ide/src/display/navigation_target.rs
index e8c3d980f..6a6b49afd 100644
--- a/crates/ra_ide/src/display/navigation_target.rs
+++ b/crates/ra_ide/src/display/navigation_target.rs
@@ -351,7 +351,7 @@ impl ToNav for hir::Local {
351 } 351 }
352} 352}
353 353
354impl ToNav for hir::GenericParam { 354impl ToNav for hir::TypeParam {
355 fn to_nav(&self, db: &RootDatabase) -> NavigationTarget { 355 fn to_nav(&self, db: &RootDatabase) -> NavigationTarget {
356 let src = self.source(db); 356 let src = self.source(db);
357 let range = match src.value { 357 let range = match src.value {
diff --git a/crates/ra_ide/src/goto_definition.rs b/crates/ra_ide/src/goto_definition.rs
index 64c0cbad4..1b968134d 100644
--- a/crates/ra_ide/src/goto_definition.rs
+++ b/crates/ra_ide/src/goto_definition.rs
@@ -66,7 +66,7 @@ pub(crate) fn reference_definition(
66 match name_kind { 66 match name_kind {
67 Some(Macro(it)) => return Exact(it.to_nav(db)), 67 Some(Macro(it)) => return Exact(it.to_nav(db)),
68 Some(Field(it)) => return Exact(it.to_nav(db)), 68 Some(Field(it)) => return Exact(it.to_nav(db)),
69 Some(GenericParam(it)) => return Exact(it.to_nav(db)), 69 Some(TypeParam(it)) => return Exact(it.to_nav(db)),
70 Some(AssocItem(it)) => return Exact(it.to_nav(db)), 70 Some(AssocItem(it)) => return Exact(it.to_nav(db)),
71 Some(Local(it)) => return Exact(it.to_nav(db)), 71 Some(Local(it)) => return Exact(it.to_nav(db)),
72 Some(Def(def)) => match NavigationTarget::from_def(db, def) { 72 Some(Def(def)) => match NavigationTarget::from_def(db, def) {
diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs
index d8185c688..d372ca758 100644
--- a/crates/ra_ide/src/hover.rs
+++ b/crates/ra_ide/src/hover.rs
@@ -138,7 +138,7 @@ fn hover_text_from_name_kind(
138 *no_fallback = true; 138 *no_fallback = true;
139 None 139 None
140 } 140 }
141 GenericParam(_) | SelfType(_) => { 141 TypeParam(_) | SelfType(_) => {
142 // FIXME: Hover for generic param 142 // FIXME: Hover for generic param
143 None 143 None
144 } 144 }
diff --git a/crates/ra_ide/src/references.rs b/crates/ra_ide/src/references.rs
index 3e7bfd872..e3ecde50d 100644
--- a/crates/ra_ide/src/references.rs
+++ b/crates/ra_ide/src/references.rs
@@ -85,7 +85,7 @@ pub(crate) fn find_all_refs(
85 NameKind::Def(def) => NavigationTarget::from_def(db, def)?, 85 NameKind::Def(def) => NavigationTarget::from_def(db, def)?,
86 NameKind::SelfType(imp) => imp.to_nav(db), 86 NameKind::SelfType(imp) => imp.to_nav(db),
87 NameKind::Local(local) => local.to_nav(db), 87 NameKind::Local(local) => local.to_nav(db),
88 NameKind::GenericParam(_) => return None, 88 NameKind::TypeParam(_) => return None,
89 }; 89 };
90 90
91 let search_scope = { 91 let search_scope = {
diff --git a/crates/ra_ide/src/references/classify.rs b/crates/ra_ide/src/references/classify.rs
index ed98dbc13..c1f091ec0 100644
--- a/crates/ra_ide/src/references/classify.rs
+++ b/crates/ra_ide/src/references/classify.rs
@@ -112,11 +112,11 @@ pub(crate) fn classify_name(db: &RootDatabase, name: InFile<&ast::Name>) -> Opti
112 }, 112 },
113 ast::TypeParam(it) => { 113 ast::TypeParam(it) => {
114 let src = name.with_value(it); 114 let src = name.with_value(it);
115 let def = hir::GenericParam::from_source(db, src)?; 115 let def = hir::TypeParam::from_source(db, src)?;
116 Some(NameDefinition { 116 Some(NameDefinition {
117 visibility: None, 117 visibility: None,
118 container: def.module(db), 118 container: def.module(db),
119 kind: NameKind::GenericParam(def), 119 kind: NameKind::TypeParam(def),
120 }) 120 })
121 }, 121 },
122 _ => None, 122 _ => None,
@@ -177,8 +177,8 @@ pub(crate) fn classify_name_ref(
177 let kind = NameKind::Local(local); 177 let kind = NameKind::Local(local);
178 Some(NameDefinition { kind, container, visibility: None }) 178 Some(NameDefinition { kind, container, visibility: None })
179 } 179 }
180 PathResolution::GenericParam(par) => { 180 PathResolution::TypeParam(par) => {
181 let kind = NameKind::GenericParam(par); 181 let kind = NameKind::TypeParam(par);
182 Some(NameDefinition { kind, container, visibility }) 182 Some(NameDefinition { kind, container, visibility })
183 } 183 }
184 PathResolution::Macro(def) => { 184 PathResolution::Macro(def) => {
diff --git a/crates/ra_ide/src/references/name_definition.rs b/crates/ra_ide/src/references/name_definition.rs
index 10d3a2364..8c67c8863 100644
--- a/crates/ra_ide/src/references/name_definition.rs
+++ b/crates/ra_ide/src/references/name_definition.rs
@@ -4,8 +4,8 @@
4//! Note that the reference search is possible for not all of the classified items. 4//! Note that the reference search is possible for not all of the classified items.
5 5
6use hir::{ 6use hir::{
7 Adt, AssocItem, GenericParam, HasSource, ImplBlock, Local, MacroDef, Module, ModuleDef, 7 Adt, AssocItem, HasSource, ImplBlock, Local, MacroDef, Module, ModuleDef, StructField,
8 StructField, VariantDef, 8 TypeParam, VariantDef,
9}; 9};
10use ra_syntax::{ast, ast::VisibilityOwner}; 10use ra_syntax::{ast, ast::VisibilityOwner};
11 11
@@ -19,7 +19,7 @@ pub enum NameKind {
19 Def(ModuleDef), 19 Def(ModuleDef),
20 SelfType(ImplBlock), 20 SelfType(ImplBlock),
21 Local(Local), 21 Local(Local),
22 GenericParam(GenericParam), 22 TypeParam(TypeParam),
23} 23}
24 24
25#[derive(PartialEq, Eq)] 25#[derive(PartialEq, Eq)]
diff --git a/crates/ra_ide/src/snapshots/rainbow_highlighting.html b/crates/ra_ide/src/snapshots/rainbow_highlighting.html
index 79f11ea80..9dfbc8047 100644
--- a/crates/ra_ide/src/snapshots/rainbow_highlighting.html
+++ b/crates/ra_ide/src/snapshots/rainbow_highlighting.html
@@ -9,6 +9,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
9.parameter { color: #94BFF3; } 9.parameter { color: #94BFF3; }
10.builtin { color: #DD6718; } 10.builtin { color: #DD6718; }
11.text { color: #DCDCCC; } 11.text { color: #DCDCCC; }
12.type { color: #7CB8BB; }
12.attribute { color: #94BFF3; } 13.attribute { color: #94BFF3; }
13.literal { color: #BFEBBF; } 14.literal { color: #BFEBBF; }
14.macro { color: #94BFF3; } 15.macro { color: #94BFF3; }
diff --git a/crates/ra_ide/src/syntax_highlighting.rs b/crates/ra_ide/src/syntax_highlighting.rs
index 20eefeb57..7ecb1a027 100644
--- a/crates/ra_ide/src/syntax_highlighting.rs
+++ b/crates/ra_ide/src/syntax_highlighting.rs
@@ -225,8 +225,7 @@ fn highlight_name(db: &RootDatabase, name_kind: NameKind) -> &'static str {
225 Def(hir::ModuleDef::Trait(_)) => "type", 225 Def(hir::ModuleDef::Trait(_)) => "type",
226 Def(hir::ModuleDef::TypeAlias(_)) => "type", 226 Def(hir::ModuleDef::TypeAlias(_)) => "type",
227 Def(hir::ModuleDef::BuiltinType(_)) => "type", 227 Def(hir::ModuleDef::BuiltinType(_)) => "type",
228 SelfType(_) => "type", 228 SelfType(_) | TypeParam(_) => "type",
229 GenericParam(_) => "type",
230 Local(local) => { 229 Local(local) => {
231 if local.is_mut(db) { 230 if local.is_mut(db) {
232 "variable.mut" 231 "variable.mut"