aboutsummaryrefslogtreecommitdiff
path: root/crates/ide
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-12-20 07:06:55 +0000
committerGitHub <[email protected]>2020-12-20 07:06:55 +0000
commitf3125555a8de6fad4529408436800a6b1243a442 (patch)
tree6cc2943b901f35ea3c351490f15cad9061a69c15 /crates/ide
parent87886e89867d36c14812e70505c4db61a6b66bf0 (diff)
parentf6ed16674c461cb20c39e787fffab2269b9629b0 (diff)
Merge #6958
6958: Align code_model name with ungrammar r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ide')
-rw-r--r--crates/ide/src/diagnostics/fixes.rs2
-rw-r--r--crates/ide/src/display/navigation_target.rs4
-rw-r--r--crates/ide/src/doc_links.rs4
-rw-r--r--crates/ide/src/hover.rs4
-rw-r--r--crates/ide/src/runnables.rs2
-rw-r--r--crates/ide/src/syntax_highlighting.rs2
6 files changed, 9 insertions, 9 deletions
diff --git a/crates/ide/src/diagnostics/fixes.rs b/crates/ide/src/diagnostics/fixes.rs
index 13240672f..e8b896623 100644
--- a/crates/ide/src/diagnostics/fixes.rs
+++ b/crates/ide/src/diagnostics/fixes.rs
@@ -166,7 +166,7 @@ fn missing_record_expr_field_fix(
166 def_file_id = source.file_id; 166 def_file_id = source.file_id;
167 source.value.record_field_list()? 167 source.value.record_field_list()?
168 } 168 }
169 VariantDef::EnumVariant(e) => { 169 VariantDef::Variant(e) => {
170 module = e.module(sema.db); 170 module = e.module(sema.db);
171 let source = e.source(sema.db); 171 let source = e.source(sema.db);
172 def_file_id = source.file_id; 172 def_file_id = source.file_id;
diff --git a/crates/ide/src/display/navigation_target.rs b/crates/ide/src/display/navigation_target.rs
index 7d0514105..cd8ec54fa 100644
--- a/crates/ide/src/display/navigation_target.rs
+++ b/crates/ide/src/display/navigation_target.rs
@@ -233,7 +233,7 @@ impl TryToNav for hir::ModuleDef {
233 hir::ModuleDef::Module(it) => it.to_nav(db), 233 hir::ModuleDef::Module(it) => it.to_nav(db),
234 hir::ModuleDef::Function(it) => it.to_nav(db), 234 hir::ModuleDef::Function(it) => it.to_nav(db),
235 hir::ModuleDef::Adt(it) => it.to_nav(db), 235 hir::ModuleDef::Adt(it) => it.to_nav(db),
236 hir::ModuleDef::EnumVariant(it) => it.to_nav(db), 236 hir::ModuleDef::Variant(it) => it.to_nav(db),
237 hir::ModuleDef::Const(it) => it.to_nav(db), 237 hir::ModuleDef::Const(it) => it.to_nav(db),
238 hir::ModuleDef::Static(it) => it.to_nav(db), 238 hir::ModuleDef::Static(it) => it.to_nav(db),
239 hir::ModuleDef::Trait(it) => it.to_nav(db), 239 hir::ModuleDef::Trait(it) => it.to_nav(db),
@@ -262,7 +262,7 @@ impl ToNavFromAst for hir::Struct {
262impl ToNavFromAst for hir::Enum { 262impl ToNavFromAst for hir::Enum {
263 const KIND: SymbolKind = SymbolKind::Enum; 263 const KIND: SymbolKind = SymbolKind::Enum;
264} 264}
265impl ToNavFromAst for hir::EnumVariant { 265impl ToNavFromAst for hir::Variant {
266 const KIND: SymbolKind = SymbolKind::Variant; 266 const KIND: SymbolKind = SymbolKind::Variant;
267} 267}
268impl ToNavFromAst for hir::Union { 268impl ToNavFromAst for hir::Union {
diff --git a/crates/ide/src/doc_links.rs b/crates/ide/src/doc_links.rs
index 79c081cac..b61ea0b3e 100644
--- a/crates/ide/src/doc_links.rs
+++ b/crates/ide/src/doc_links.rs
@@ -181,7 +181,7 @@ fn rewrite_intra_doc_link(
181 ModuleDef::Module(it) => it.resolve_doc_path(db, link, ns), 181 ModuleDef::Module(it) => it.resolve_doc_path(db, link, ns),
182 ModuleDef::Function(it) => it.resolve_doc_path(db, link, ns), 182 ModuleDef::Function(it) => it.resolve_doc_path(db, link, ns),
183 ModuleDef::Adt(it) => it.resolve_doc_path(db, link, ns), 183 ModuleDef::Adt(it) => it.resolve_doc_path(db, link, ns),
184 ModuleDef::EnumVariant(it) => it.resolve_doc_path(db, link, ns), 184 ModuleDef::Variant(it) => it.resolve_doc_path(db, link, ns),
185 ModuleDef::Const(it) => it.resolve_doc_path(db, link, ns), 185 ModuleDef::Const(it) => it.resolve_doc_path(db, link, ns),
186 ModuleDef::Static(it) => it.resolve_doc_path(db, link, ns), 186 ModuleDef::Static(it) => it.resolve_doc_path(db, link, ns),
187 ModuleDef::Trait(it) => it.resolve_doc_path(db, link, ns), 187 ModuleDef::Trait(it) => it.resolve_doc_path(db, link, ns),
@@ -390,7 +390,7 @@ fn get_symbol_filename(db: &dyn HirDatabase, definition: &ModuleDef) -> Option<S
390 ModuleDef::TypeAlias(t) => format!("type.{}.html", t.name(db)), 390 ModuleDef::TypeAlias(t) => format!("type.{}.html", t.name(db)),
391 ModuleDef::BuiltinType(t) => format!("primitive.{}.html", t.as_name()), 391 ModuleDef::BuiltinType(t) => format!("primitive.{}.html", t.as_name()),
392 ModuleDef::Function(f) => format!("fn.{}.html", f.name(db)), 392 ModuleDef::Function(f) => format!("fn.{}.html", f.name(db)),
393 ModuleDef::EnumVariant(ev) => { 393 ModuleDef::Variant(ev) => {
394 format!("enum.{}.html#variant.{}", ev.parent_enum(db).name(db), ev.name(db)) 394 format!("enum.{}.html#variant.{}", ev.parent_enum(db).name(db), ev.name(db))
395 } 395 }
396 ModuleDef::Const(c) => format!("const.{}.html", c.name(db)?), 396 ModuleDef::Const(c) => format!("const.{}.html", c.name(db)?),
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs
index b06fa5f15..52f993cc9 100644
--- a/crates/ide/src/hover.rs
+++ b/crates/ide/src/hover.rs
@@ -297,7 +297,7 @@ fn definition_owner_name(db: &RootDatabase, def: &Definition) -> Option<String>
297 AssocItemContainer::Trait(t) => Some(t.name(db)), 297 AssocItemContainer::Trait(t) => Some(t.name(db)),
298 AssocItemContainer::Impl(i) => i.target_ty(db).as_adt().map(|adt| adt.name(db)), 298 AssocItemContainer::Impl(i) => i.target_ty(db).as_adt().map(|adt| adt.name(db)),
299 }, 299 },
300 ModuleDef::EnumVariant(e) => Some(e.parent_enum(db).name(db)), 300 ModuleDef::Variant(e) => Some(e.parent_enum(db).name(db)),
301 _ => None, 301 _ => None,
302 }, 302 },
303 _ => None, 303 _ => None,
@@ -355,7 +355,7 @@ fn hover_for_definition(db: &RootDatabase, def: Definition) -> Option<Markup> {
355 ModuleDef::Adt(Adt::Struct(it)) => from_def_source(db, it, mod_path), 355 ModuleDef::Adt(Adt::Struct(it)) => from_def_source(db, it, mod_path),
356 ModuleDef::Adt(Adt::Union(it)) => from_def_source(db, it, mod_path), 356 ModuleDef::Adt(Adt::Union(it)) => from_def_source(db, it, mod_path),
357 ModuleDef::Adt(Adt::Enum(it)) => from_def_source(db, it, mod_path), 357 ModuleDef::Adt(Adt::Enum(it)) => from_def_source(db, it, mod_path),
358 ModuleDef::EnumVariant(it) => from_def_source(db, it, mod_path), 358 ModuleDef::Variant(it) => from_def_source(db, it, mod_path),
359 ModuleDef::Const(it) => from_def_source(db, it, mod_path), 359 ModuleDef::Const(it) => from_def_source(db, it, mod_path),
360 ModuleDef::Static(it) => from_def_source(db, it, mod_path), 360 ModuleDef::Static(it) => from_def_source(db, it, mod_path),
361 ModuleDef::Trait(it) => from_def_source(db, it, mod_path), 361 ModuleDef::Trait(it) => from_def_source(db, it, mod_path),
diff --git a/crates/ide/src/runnables.rs b/crates/ide/src/runnables.rs
index ff386be80..2f2b99130 100644
--- a/crates/ide/src/runnables.rs
+++ b/crates/ide/src/runnables.rs
@@ -167,7 +167,7 @@ fn module_def_doctest(sema: &Semantics<RootDatabase>, def: hir::ModuleDef) -> Op
167 hir::ModuleDef::Module(it) => it.attrs(sema.db), 167 hir::ModuleDef::Module(it) => it.attrs(sema.db),
168 hir::ModuleDef::Function(it) => it.attrs(sema.db), 168 hir::ModuleDef::Function(it) => it.attrs(sema.db),
169 hir::ModuleDef::Adt(it) => it.attrs(sema.db), 169 hir::ModuleDef::Adt(it) => it.attrs(sema.db),
170 hir::ModuleDef::EnumVariant(it) => it.attrs(sema.db), 170 hir::ModuleDef::Variant(it) => it.attrs(sema.db),
171 hir::ModuleDef::Const(it) => it.attrs(sema.db), 171 hir::ModuleDef::Const(it) => it.attrs(sema.db),
172 hir::ModuleDef::Static(it) => it.attrs(sema.db), 172 hir::ModuleDef::Static(it) => it.attrs(sema.db),
173 hir::ModuleDef::Trait(it) => it.attrs(sema.db), 173 hir::ModuleDef::Trait(it) => it.attrs(sema.db),
diff --git a/crates/ide/src/syntax_highlighting.rs b/crates/ide/src/syntax_highlighting.rs
index 67ad7c63d..00c717c7c 100644
--- a/crates/ide/src/syntax_highlighting.rs
+++ b/crates/ide/src/syntax_highlighting.rs
@@ -781,7 +781,7 @@ fn highlight_def(db: &RootDatabase, def: Definition) -> Highlight {
781 hir::ModuleDef::Adt(hir::Adt::Struct(_)) => HighlightTag::Symbol(SymbolKind::Struct), 781 hir::ModuleDef::Adt(hir::Adt::Struct(_)) => HighlightTag::Symbol(SymbolKind::Struct),
782 hir::ModuleDef::Adt(hir::Adt::Enum(_)) => HighlightTag::Symbol(SymbolKind::Enum), 782 hir::ModuleDef::Adt(hir::Adt::Enum(_)) => HighlightTag::Symbol(SymbolKind::Enum),
783 hir::ModuleDef::Adt(hir::Adt::Union(_)) => HighlightTag::Symbol(SymbolKind::Union), 783 hir::ModuleDef::Adt(hir::Adt::Union(_)) => HighlightTag::Symbol(SymbolKind::Union),
784 hir::ModuleDef::EnumVariant(_) => HighlightTag::Symbol(SymbolKind::Variant), 784 hir::ModuleDef::Variant(_) => HighlightTag::Symbol(SymbolKind::Variant),
785 hir::ModuleDef::Const(konst) => { 785 hir::ModuleDef::Const(konst) => {
786 let mut h = Highlight::new(HighlightTag::Symbol(SymbolKind::Const)); 786 let mut h = Highlight::new(HighlightTag::Symbol(SymbolKind::Const));
787 if konst.as_assoc_item(db).is_some() { 787 if konst.as_assoc_item(db).is_some() {