aboutsummaryrefslogtreecommitdiff
path: root/crates/rust-analyzer/src/handlers.rs
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2021-05-03 17:35:44 +0100
committerKirill Bulatov <[email protected]>2021-05-03 17:35:44 +0100
commit90fc32937785b3f17899f14d8cb2f7b3738a9850 (patch)
treebf08a9fb84231de75ca7cf494df3d6caebbcbe62 /crates/rust-analyzer/src/handlers.rs
parent3eab6ce2e3eef6c8dca1127b4c1375899bf13b8c (diff)
Index retrieval fix
Diffstat (limited to 'crates/rust-analyzer/src/handlers.rs')
-rw-r--r--crates/rust-analyzer/src/handlers.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs
index 77faf7579..0fd03bbaa 100644
--- a/crates/rust-analyzer/src/handlers.rs
+++ b/crates/rust-analyzer/src/handlers.rs
@@ -1076,7 +1076,17 @@ pub(crate) fn handle_code_action_resolve(
1076 frange, 1076 frange,
1077 )?; 1077 )?;
1078 1078
1079 let assist = &assists[params.index]; 1079 let assist = match assists.get(params.index) {
1080 Some(assist) => assist,
1081 None => return Err(LspError::new(
1082 ErrorCode::InvalidParams as i32,
1083 format!(
1084 "Failed to find the assist for index {} provided by the resolve request. Expected assist id: {:?}",
1085 params.index, params.id,
1086 ),
1087 )
1088 .into())
1089 };
1080 if assist.id.0 != params.id || assist.id.1 != assist_kind { 1090 if assist.id.0 != params.id || assist.id.1 != assist_kind {
1081 return Err(LspError::new( 1091 return Err(LspError::new(
1082 ErrorCode::InvalidParams as i32, 1092 ErrorCode::InvalidParams as i32,