mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
Rename
This commit is contained in:
parent
0265778e86
commit
edc0190f7a
@ -43,7 +43,7 @@ use crate::{
|
||||
completion::{
|
||||
CompletionContext, CompletionItem, CompletionItemKind, CompletionKind, Completions,
|
||||
},
|
||||
display::function_label,
|
||||
display::function_declaration,
|
||||
};
|
||||
|
||||
pub(crate) fn complete_trait_impl(acc: &mut Completions, ctx: &CompletionContext) {
|
||||
@ -144,7 +144,7 @@ fn add_function_impl(
|
||||
};
|
||||
let range = TextRange::new(fn_def_node.text_range().start(), ctx.source_range().end());
|
||||
|
||||
let function_decl = function_label(&func.source(ctx.db).value);
|
||||
let function_decl = function_declaration(&func.source(ctx.db).value);
|
||||
match ctx.config.snippet_cap {
|
||||
Some(cap) => {
|
||||
let snippet = format!("{} {{\n $0\n}}", function_decl);
|
||||
|
@ -12,7 +12,8 @@ use crate::{
|
||||
CompletionKind, Completions,
|
||||
},
|
||||
display::{
|
||||
const_label, function_label, function_signature::FunctionSignature, macro_label, type_label,
|
||||
const_label, function_declaration, function_signature::FunctionSignature, macro_label,
|
||||
type_label,
|
||||
},
|
||||
CompletionScore, RootDatabase,
|
||||
};
|
||||
@ -208,7 +209,7 @@ impl Completions {
|
||||
})
|
||||
.set_documentation(func.docs(ctx.db))
|
||||
.set_deprecated(is_deprecated(func, ctx.db))
|
||||
.detail(function_label(&ast_node));
|
||||
.detail(function_declaration(&ast_node));
|
||||
|
||||
let params = function_signature
|
||||
.parameter_names
|
||||
|
@ -10,14 +10,14 @@ use ra_syntax::{
|
||||
SyntaxKind::{ATTR, COMMENT},
|
||||
};
|
||||
|
||||
use ast::VisibilityOwner;
|
||||
use stdx::format_to;
|
||||
|
||||
pub use navigation_target::NavigationTarget;
|
||||
pub(crate) use navigation_target::{ToNav, TryToNav};
|
||||
pub(crate) use short_label::ShortLabel;
|
||||
|
||||
use ast::VisibilityOwner;
|
||||
pub use navigation_target::NavigationTarget;
|
||||
use stdx::format_to;
|
||||
|
||||
pub(crate) fn function_label(node: &ast::FnDef) -> String {
|
||||
pub(crate) fn function_declaration(node: &ast::FnDef) -> String {
|
||||
let mut buf = String::new();
|
||||
if let Some(vis) = node.visibility() {
|
||||
format_to!(buf, "{} ", vis);
|
||||
|
@ -9,7 +9,7 @@ pub(crate) trait ShortLabel {
|
||||
|
||||
impl ShortLabel for ast::FnDef {
|
||||
fn short_label(&self) -> Option<String> {
|
||||
Some(crate::display::function_label(self))
|
||||
Some(crate::display::function_declaration(self))
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user