mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-31 07:37:30 +00:00
Align code_model name with ungrammar
This commit is contained in:
parent
87886e8986
commit
f6ed16674c
22 changed files with 88 additions and 102 deletions
|
@ -166,7 +166,7 @@ fn missing_record_expr_field_fix(
|
|||
def_file_id = source.file_id;
|
||||
source.value.record_field_list()?
|
||||
}
|
||||
VariantDef::EnumVariant(e) => {
|
||||
VariantDef::Variant(e) => {
|
||||
module = e.module(sema.db);
|
||||
let source = e.source(sema.db);
|
||||
def_file_id = source.file_id;
|
||||
|
|
|
@ -233,7 +233,7 @@ impl TryToNav for hir::ModuleDef {
|
|||
hir::ModuleDef::Module(it) => it.to_nav(db),
|
||||
hir::ModuleDef::Function(it) => it.to_nav(db),
|
||||
hir::ModuleDef::Adt(it) => it.to_nav(db),
|
||||
hir::ModuleDef::EnumVariant(it) => it.to_nav(db),
|
||||
hir::ModuleDef::Variant(it) => it.to_nav(db),
|
||||
hir::ModuleDef::Const(it) => it.to_nav(db),
|
||||
hir::ModuleDef::Static(it) => it.to_nav(db),
|
||||
hir::ModuleDef::Trait(it) => it.to_nav(db),
|
||||
|
@ -262,7 +262,7 @@ impl ToNavFromAst for hir::Struct {
|
|||
impl ToNavFromAst for hir::Enum {
|
||||
const KIND: SymbolKind = SymbolKind::Enum;
|
||||
}
|
||||
impl ToNavFromAst for hir::EnumVariant {
|
||||
impl ToNavFromAst for hir::Variant {
|
||||
const KIND: SymbolKind = SymbolKind::Variant;
|
||||
}
|
||||
impl ToNavFromAst for hir::Union {
|
||||
|
|
|
@ -181,7 +181,7 @@ fn rewrite_intra_doc_link(
|
|||
ModuleDef::Module(it) => it.resolve_doc_path(db, link, ns),
|
||||
ModuleDef::Function(it) => it.resolve_doc_path(db, link, ns),
|
||||
ModuleDef::Adt(it) => it.resolve_doc_path(db, link, ns),
|
||||
ModuleDef::EnumVariant(it) => it.resolve_doc_path(db, link, ns),
|
||||
ModuleDef::Variant(it) => it.resolve_doc_path(db, link, ns),
|
||||
ModuleDef::Const(it) => it.resolve_doc_path(db, link, ns),
|
||||
ModuleDef::Static(it) => it.resolve_doc_path(db, link, ns),
|
||||
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
|
|||
ModuleDef::TypeAlias(t) => format!("type.{}.html", t.name(db)),
|
||||
ModuleDef::BuiltinType(t) => format!("primitive.{}.html", t.as_name()),
|
||||
ModuleDef::Function(f) => format!("fn.{}.html", f.name(db)),
|
||||
ModuleDef::EnumVariant(ev) => {
|
||||
ModuleDef::Variant(ev) => {
|
||||
format!("enum.{}.html#variant.{}", ev.parent_enum(db).name(db), ev.name(db))
|
||||
}
|
||||
ModuleDef::Const(c) => format!("const.{}.html", c.name(db)?),
|
||||
|
|
|
@ -297,7 +297,7 @@ fn definition_owner_name(db: &RootDatabase, def: &Definition) -> Option<String>
|
|||
AssocItemContainer::Trait(t) => Some(t.name(db)),
|
||||
AssocItemContainer::Impl(i) => i.target_ty(db).as_adt().map(|adt| adt.name(db)),
|
||||
},
|
||||
ModuleDef::EnumVariant(e) => Some(e.parent_enum(db).name(db)),
|
||||
ModuleDef::Variant(e) => Some(e.parent_enum(db).name(db)),
|
||||
_ => None,
|
||||
},
|
||||
_ => None,
|
||||
|
@ -355,7 +355,7 @@ fn hover_for_definition(db: &RootDatabase, def: Definition) -> Option<Markup> {
|
|||
ModuleDef::Adt(Adt::Struct(it)) => from_def_source(db, it, mod_path),
|
||||
ModuleDef::Adt(Adt::Union(it)) => from_def_source(db, it, mod_path),
|
||||
ModuleDef::Adt(Adt::Enum(it)) => from_def_source(db, it, mod_path),
|
||||
ModuleDef::EnumVariant(it) => from_def_source(db, it, mod_path),
|
||||
ModuleDef::Variant(it) => from_def_source(db, it, mod_path),
|
||||
ModuleDef::Const(it) => from_def_source(db, it, mod_path),
|
||||
ModuleDef::Static(it) => from_def_source(db, it, mod_path),
|
||||
ModuleDef::Trait(it) => from_def_source(db, it, mod_path),
|
||||
|
|
|
@ -167,7 +167,7 @@ fn module_def_doctest(sema: &Semantics<RootDatabase>, def: hir::ModuleDef) -> Op
|
|||
hir::ModuleDef::Module(it) => it.attrs(sema.db),
|
||||
hir::ModuleDef::Function(it) => it.attrs(sema.db),
|
||||
hir::ModuleDef::Adt(it) => it.attrs(sema.db),
|
||||
hir::ModuleDef::EnumVariant(it) => it.attrs(sema.db),
|
||||
hir::ModuleDef::Variant(it) => it.attrs(sema.db),
|
||||
hir::ModuleDef::Const(it) => it.attrs(sema.db),
|
||||
hir::ModuleDef::Static(it) => it.attrs(sema.db),
|
||||
hir::ModuleDef::Trait(it) => it.attrs(sema.db),
|
||||
|
|
|
@ -781,7 +781,7 @@ fn highlight_def(db: &RootDatabase, def: Definition) -> Highlight {
|
|||
hir::ModuleDef::Adt(hir::Adt::Struct(_)) => HighlightTag::Symbol(SymbolKind::Struct),
|
||||
hir::ModuleDef::Adt(hir::Adt::Enum(_)) => HighlightTag::Symbol(SymbolKind::Enum),
|
||||
hir::ModuleDef::Adt(hir::Adt::Union(_)) => HighlightTag::Symbol(SymbolKind::Union),
|
||||
hir::ModuleDef::EnumVariant(_) => HighlightTag::Symbol(SymbolKind::Variant),
|
||||
hir::ModuleDef::Variant(_) => HighlightTag::Symbol(SymbolKind::Variant),
|
||||
hir::ModuleDef::Const(konst) => {
|
||||
let mut h = Highlight::new(HighlightTag::Symbol(SymbolKind::Const));
|
||||
if konst.as_assoc_item(db).is_some() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue