mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-21 20:23:21 +00:00
Index retrieval fix
This commit is contained in:
parent
3eab6ce2e3
commit
90fc329377
@ -102,7 +102,7 @@ pub enum AssistResolveStrategy {
|
||||
None,
|
||||
/// All assists should be resolved.
|
||||
All,
|
||||
/// Only a certain assists should be resolved.
|
||||
/// Only a certain assist should be resolved.
|
||||
Single(SingleResolve),
|
||||
}
|
||||
|
||||
|
@ -1076,7 +1076,17 @@ pub(crate) fn handle_code_action_resolve(
|
||||
frange,
|
||||
)?;
|
||||
|
||||
let assist = &assists[params.index];
|
||||
let assist = match assists.get(params.index) {
|
||||
Some(assist) => assist,
|
||||
None => return Err(LspError::new(
|
||||
ErrorCode::InvalidParams as i32,
|
||||
format!(
|
||||
"Failed to find the assist for index {} provided by the resolve request. Expected assist id: {:?}",
|
||||
params.index, params.id,
|
||||
),
|
||||
)
|
||||
.into())
|
||||
};
|
||||
if assist.id.0 != params.id || assist.id.1 != assist_kind {
|
||||
return Err(LspError::new(
|
||||
ErrorCode::InvalidParams as i32,
|
||||
|
Loading…
Reference in New Issue
Block a user