use ide_db::{base_db::FileId, defs::Definition, search::FileReference};
use syntax::{
algo::find_node_at_range,
- ast::{self, ArgListOwner},
+ ast::{self, HasArgList},
AstNode, SourceFile, SyntaxKind, SyntaxNode, TextRange, T,
};
}
let fn_def = {
let func = ctx.sema.to_def(&func)?;
- Definition::ModuleDef(func.into())
+ Definition::Function(func)
};
let param_def = {
return Some(range_to_remove(arg.syntax()));
}
- return None;
+ None
}
-fn range_to_remove(node: &SyntaxNode) -> TextRange {
+pub(crate) fn range_to_remove(node: &SyntaxNode) -> TextRange {
let up_to_comma = next_prev().find_map(|dir| {
node.siblings_with_tokens(dir)
.filter_map(|it| it.into_token())