Migrate inline_call assist to SyntaxFactory#22352
Conversation
This comment has been minimized.
This comment has been minimized.
42b6221 to
5295623
Compare
Thanks for the feedback, I tried to address it, let me know if I'm on the right track. |
|
|
||
| let params = get_fn_params(ctx.sema.db, function, ¶m_list)?; | ||
| let def_file_editor = SyntaxEditor::new( | ||
| ast_func.syntax().ancestors().last().unwrap_or_else(|| ast_func.syntax().clone()), |
There was a problem hiding this comment.
| ast_func.syntax().ancestors().last().unwrap_or_else(|| ast_func.syntax().clone()), | |
| ast_func.syntax().ancestors().last().unwrap(), |
There is always a top ancestor (maybe we should have a method for that).
There was a problem hiding this comment.
addressed (did not attempt to introduce a new method in this PR, frankly I'd need a guidance where would be the best place for such a method to live)
| .0; | ||
| let params = get_fn_params(ctx.sema.db, function, ¶m_list, &def_file_editor)?; | ||
|
|
||
| let mut file_editors: FxHashMap<FileId, SyntaxEditor> = FxHashMap::default(); |
There was a problem hiding this comment.
| let mut file_editors: FxHashMap<FileId, SyntaxEditor> = FxHashMap::default(); | |
| let mut file_editors = FxHashMap::default(); |
| } | ||
| let params = get_fn_params(ctx.sema.db, function, ¶m_list)?; | ||
| let syntax = call_info.node.syntax().clone(); | ||
| let editor = SyntaxEditor::new(syntax.ancestors().last().unwrap_or_else(|| syntax.clone())).0; |
There was a problem hiding this comment.
| let editor = SyntaxEditor::new(syntax.ancestors().last().unwrap_or_else(|| syntax.clone())).0; | |
| let editor = SyntaxEditor::new(syntax.ancestors().last().unwrap()).0; |
| db: &'db dyn HirDatabase, | ||
| function: hir::Function, | ||
| param_list: &ast::ParamList, | ||
| file_editor: &SyntaxEditor, |
There was a problem hiding this comment.
Given this only uses make, better to pass only it.
9dbf0e4 to
74af81d
Compare
This comment has been minimized.
This comment has been minimized.
74af81d to
ad15548
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
ad15548 to
3efd9b0
Compare
Replaces the two remaining
make::calls inget_fn_params.Part of #18285.