prepare to move run/debug splitting to handlers
This commit is contained in:
@@ -988,9 +988,10 @@ pub(crate) fn runnable(
|
||||
}
|
||||
|
||||
pub(crate) fn code_lens(
|
||||
acc: &mut Vec<lsp_types::CodeLens>,
|
||||
snap: &GlobalStateSnapshot,
|
||||
annotation: Annotation,
|
||||
) -> Result<lsp_types::CodeLens> {
|
||||
) -> Result<()> {
|
||||
match annotation.kind {
|
||||
AnnotationKind::Runnable { debug, runnable: run } => {
|
||||
let line_index = snap.file_line_index(run.nav.file_id)?;
|
||||
@@ -1002,7 +1003,11 @@ pub(crate) fn code_lens(
|
||||
let command =
|
||||
if debug { command::debug_single(&r) } else { command::run_single(&r, &title) };
|
||||
|
||||
Ok(lsp_types::CodeLens { range: annotation_range, command: Some(command), data: None })
|
||||
acc.push(lsp_types::CodeLens {
|
||||
range: annotation_range,
|
||||
command: Some(command),
|
||||
data: None,
|
||||
})
|
||||
}
|
||||
AnnotationKind::HasImpls { position: file_position, data } => {
|
||||
let line_index = snap.file_line_index(file_position.file_id)?;
|
||||
@@ -1041,7 +1046,7 @@ pub(crate) fn code_lens(
|
||||
)
|
||||
});
|
||||
|
||||
Ok(lsp_types::CodeLens {
|
||||
acc.push(lsp_types::CodeLens {
|
||||
range: annotation_range,
|
||||
command,
|
||||
data: Some(to_value(lsp_ext::CodeLensResolveData::Impls(goto_params)).unwrap()),
|
||||
@@ -1070,13 +1075,14 @@ pub(crate) fn code_lens(
|
||||
)
|
||||
});
|
||||
|
||||
Ok(lsp_types::CodeLens {
|
||||
acc.push(lsp_types::CodeLens {
|
||||
range: annotation_range,
|
||||
command,
|
||||
data: Some(to_value(lsp_ext::CodeLensResolveData::References(doc_pos)).unwrap()),
|
||||
})
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(crate) mod command {
|
||||
|
||||
Reference in New Issue
Block a user