Remove waiting for edits when handling code action RPC requests

Add code actions to the randomized integration test

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld 2022-02-16 17:34:23 -08:00
parent 41ba980c9b
commit 3315750361
2 changed files with 27 additions and 6 deletions

View file

@ -3622,6 +3622,15 @@ mod tests {
..Default::default()
}]))
});
fake_server.handle_request::<lsp::request::CodeActionRequest, _>(|_| {
Some(vec![lsp::CodeActionOrCommand::CodeAction(
lsp::CodeAction {
title: "the-code-action".to_string(),
..Default::default()
},
)])
});
});
Arc::get_mut(&mut host_lang_registry)
@ -4180,7 +4189,7 @@ mod tests {
drop(buffer);
});
}
10..=19 => {
10..=14 => {
project
.update(&mut cx, |project, cx| {
log::info!(
@ -4193,6 +4202,19 @@ mod tests {
.await
.expect("completion request failed");
}
15..=19 => {
project
.update(&mut cx, |project, cx| {
log::info!(
"Guest {}: requesting code actions for buffer {:?}",
guest_id,
buffer.read(cx).file().unwrap().full_path(cx)
);
project.code_actions(&buffer, 0..0, cx)
})
.await
.expect("completion request failed");
}
_ => {
buffer.update(&mut cx, |buffer, cx| {
log::info!(