Fixed ssh remoting not showing a lot of hints Release Notes: - N/A
Unified · Split
| @@ -2439,15 +2439,13 @@ impl InlayHints { · 2438 unmodified lines | ||
| 2439 | 2439 | ResolveState::Resolved => (0, None), |
| 2440 | 2440 | ResolveState::CanResolve(server_id, resolve_data) => ( |
| 2441 | 2441 | 1, |
| 2442 | − resolve_data | |
| 2443 | − .map(|json_data| { | |
| 2442 | + Some(proto::resolve_state::LspResolveState { | |
| 2443 | + server_id: server_id.0 as u64, | |
| 2444 | + value: resolve_data.map(|json_data| { | |
| 2444 | 2445 | serde_json::to_string(&json_data) |
| 2445 | 2446 | .expect("failed to serialize resolve json data") |
| 2446 | − }) | |
| 2447 | − .map(|value| proto::resolve_state::LspResolveState { | |
| 2448 | − server_id: server_id.0 as u64, | |
| 2449 | − value, | |
| 2450 | 2447 | }), |
| 2448 | + }), | |
| 2451 | 2449 | ), |
| 2452 | 2450 | ResolveState::Resolving => (2, None), |
| 2453 | 2451 | }; |
| @@ -2515,9 +2513,11 @@ impl InlayHints { · 61 unmodified lines | ||
| 2515 | 2513 | let resolve_state_data = resolve_state |
| 2516 | 2514 | .lsp_resolve_state.as_ref() |
| 2517 | 2515 | .map(|lsp_resolve_state| { |
| 2518 | − serde_json::from_str::<Option<lsp::LSPAny>>(&lsp_resolve_state.value) | |
| 2519 | − .with_context(|| format!("incorrect proto inlay hint message: non-json resolve state {lsp_resolve_state:?}")) | |
| 2520 | − .map(|state| (LanguageServerId(lsp_resolve_state.server_id as usize), state)) | |
| 2516 | + let value = lsp_resolve_state.value.as_deref().map(|value| { | |
| 2517 | + serde_json::from_str::<Option<lsp::LSPAny>>(value) | |
| 2518 | + .with_context(|| format!("incorrect proto inlay hint message: non-json resolve state {lsp_resolve_state:?}")) | |
| 2519 | + }).transpose()?.flatten(); | |
| 2520 | + anyhow::Ok((LanguageServerId(lsp_resolve_state.server_id as usize), value)) | |
| 2521 | 2521 | }) |
| 2522 | 2522 | .transpose()?; |
| 2523 | 2523 | let resolve_state = match resolve_state.state { |
| @@ -1207,7 +1207,7 @@ message ResolveState { · 1206 unmodified lines | ||
| 1207 | 1207 | } |
| 1208 | 1208 | |
| 1209 | 1209 | message LspResolveState { |
| 1210 | − string value = 1; | |
| 1210 | + optional string value = 1; | |
| 1211 | 1211 | uint64 server_id = 2; |
| 1212 | 1212 | } |
| 1213 | 1213 | } |