mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
misc improvements
This commit is contained in:
@@ -234,17 +234,13 @@ pub(crate) fn add_path_resolution(
|
||||
Visible::Editable => true,
|
||||
Visible::No => return,
|
||||
};
|
||||
self.add(
|
||||
render_path_resolution(
|
||||
RenderContext::new(ctx)
|
||||
.private_editable(is_private_editable)
|
||||
.doc_aliases(doc_aliases),
|
||||
path_ctx,
|
||||
local_name,
|
||||
resolution,
|
||||
)
|
||||
.build(ctx.db),
|
||||
);
|
||||
render_path_resolution(
|
||||
RenderContext::new(ctx).private_editable(is_private_editable).doc_aliases(doc_aliases),
|
||||
path_ctx,
|
||||
local_name,
|
||||
resolution,
|
||||
)
|
||||
.add_to(self, ctx.db);
|
||||
}
|
||||
|
||||
pub(crate) fn add_pattern_resolution(
|
||||
@@ -259,15 +255,13 @@ pub(crate) fn add_pattern_resolution(
|
||||
Visible::Editable => true,
|
||||
Visible::No => return,
|
||||
};
|
||||
self.add(
|
||||
render_pattern_resolution(
|
||||
RenderContext::new(ctx).private_editable(is_private_editable),
|
||||
pattern_ctx,
|
||||
local_name,
|
||||
resolution,
|
||||
)
|
||||
.build(ctx.db),
|
||||
);
|
||||
render_pattern_resolution(
|
||||
RenderContext::new(ctx).private_editable(is_private_editable),
|
||||
pattern_ctx,
|
||||
local_name,
|
||||
resolution,
|
||||
)
|
||||
.add_to(self, ctx.db);
|
||||
}
|
||||
|
||||
pub(crate) fn add_enum_variants(
|
||||
@@ -310,15 +304,13 @@ pub(crate) fn add_macro(
|
||||
Visible::Editable => true,
|
||||
Visible::No => return,
|
||||
};
|
||||
self.add(
|
||||
render_macro(
|
||||
RenderContext::new(ctx).private_editable(is_private_editable),
|
||||
path_ctx,
|
||||
local_name,
|
||||
mac,
|
||||
)
|
||||
.build(ctx.db),
|
||||
);
|
||||
render_macro(
|
||||
RenderContext::new(ctx).private_editable(is_private_editable),
|
||||
path_ctx,
|
||||
local_name,
|
||||
mac,
|
||||
)
|
||||
.add_to(self, ctx.db);
|
||||
}
|
||||
|
||||
pub(crate) fn add_function(
|
||||
@@ -334,17 +326,13 @@ pub(crate) fn add_function(
|
||||
Visible::No => return,
|
||||
};
|
||||
let doc_aliases = ctx.doc_aliases(&func);
|
||||
self.add(
|
||||
render_fn(
|
||||
RenderContext::new(ctx)
|
||||
.private_editable(is_private_editable)
|
||||
.doc_aliases(doc_aliases),
|
||||
path_ctx,
|
||||
local_name,
|
||||
func,
|
||||
)
|
||||
.build(ctx.db),
|
||||
);
|
||||
render_fn(
|
||||
RenderContext::new(ctx).private_editable(is_private_editable).doc_aliases(doc_aliases),
|
||||
path_ctx,
|
||||
local_name,
|
||||
func,
|
||||
)
|
||||
.add_to(self, ctx.db);
|
||||
}
|
||||
|
||||
pub(crate) fn add_method(
|
||||
@@ -361,18 +349,14 @@ pub(crate) fn add_method(
|
||||
Visible::No => return,
|
||||
};
|
||||
let doc_aliases = ctx.doc_aliases(&func);
|
||||
self.add(
|
||||
render_method(
|
||||
RenderContext::new(ctx)
|
||||
.private_editable(is_private_editable)
|
||||
.doc_aliases(doc_aliases),
|
||||
dot_access,
|
||||
receiver,
|
||||
local_name,
|
||||
func,
|
||||
)
|
||||
.build(ctx.db),
|
||||
);
|
||||
render_method(
|
||||
RenderContext::new(ctx).private_editable(is_private_editable).doc_aliases(doc_aliases),
|
||||
dot_access,
|
||||
receiver,
|
||||
local_name,
|
||||
func,
|
||||
)
|
||||
.add_to(self, ctx.db);
|
||||
}
|
||||
|
||||
pub(crate) fn add_method_with_import(
|
||||
@@ -388,19 +372,17 @@ pub(crate) fn add_method_with_import(
|
||||
Visible::No => return,
|
||||
};
|
||||
let doc_aliases = ctx.doc_aliases(&func);
|
||||
self.add(
|
||||
render_method(
|
||||
RenderContext::new(ctx)
|
||||
.private_editable(is_private_editable)
|
||||
.doc_aliases(doc_aliases)
|
||||
.import_to_add(Some(import)),
|
||||
dot_access,
|
||||
None,
|
||||
None,
|
||||
func,
|
||||
)
|
||||
.build(ctx.db),
|
||||
);
|
||||
render_method(
|
||||
RenderContext::new(ctx)
|
||||
.private_editable(is_private_editable)
|
||||
.doc_aliases(doc_aliases)
|
||||
.import_to_add(Some(import)),
|
||||
dot_access,
|
||||
None,
|
||||
None,
|
||||
func,
|
||||
)
|
||||
.add_to(self, ctx.db);
|
||||
}
|
||||
|
||||
pub(crate) fn add_const(&mut self, ctx: &CompletionContext<'_>, konst: hir::Const) {
|
||||
|
||||
@@ -111,8 +111,7 @@ fn is_deprecated_assoc_item(&self, as_assoc_item: impl AsAssocItem) -> bool {
|
||||
is_assoc_deprecated
|
||||
|| assoc
|
||||
.container_or_implemented_trait(db)
|
||||
.map(|trait_| self.is_deprecated(trait_))
|
||||
.unwrap_or(false)
|
||||
.is_some_and(|trait_| self.is_deprecated(trait_))
|
||||
}
|
||||
|
||||
// FIXME: remove this
|
||||
|
||||
Reference in New Issue
Block a user