Don't make fields private unless you have to
This commit is contained in:
@@ -859,10 +859,10 @@ pub(crate) fn handle_resolve_code_action(
|
||||
.map(|it| it.into_iter().filter_map(from_proto::assist_kind).collect());
|
||||
|
||||
let assists = snap.analysis.resolved_assists(&snap.config.assist, frange)?;
|
||||
let (id_string, index) = split_once(¶ms.id, ':').unwrap();
|
||||
let (id, index) = split_once(¶ms.id, ':').unwrap();
|
||||
let index = index.parse::<usize>().unwrap();
|
||||
let assist = &assists[index];
|
||||
assert!(assist.assist.id().0 == id_string);
|
||||
assert!(assist.assist.id.0 == id);
|
||||
Ok(to_proto::resolved_code_action(&snap, assist.clone())?.edit)
|
||||
}
|
||||
|
||||
|
||||
@@ -704,10 +704,10 @@ pub(crate) fn unresolved_code_action(
|
||||
index: usize,
|
||||
) -> Result<lsp_ext::CodeAction> {
|
||||
let res = lsp_ext::CodeAction {
|
||||
title: assist.label(),
|
||||
id: Some(format!("{}:{}", assist.id().0.to_owned(), index.to_string())),
|
||||
group: assist.group().filter(|_| snap.config.client_caps.code_action_group).map(|gr| gr.0),
|
||||
kind: Some(code_action_kind(assist.id().1)),
|
||||
title: assist.label().to_string(),
|
||||
id: Some(format!("{}:{}", assist.id.0, index.to_string())),
|
||||
group: assist.group.filter(|_| snap.config.client_caps.code_action_group).map(|gr| gr.0),
|
||||
kind: Some(code_action_kind(assist.id.1)),
|
||||
edit: None,
|
||||
is_preferred: None,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user