Store inlay hint resolve data

This commit is contained in:
Kirill Bulatov 2023-08-18 15:54:30 +03:00
parent e4b78e322e
commit 3434990b70
4 changed files with 134 additions and 53 deletions

View file

@ -342,6 +342,22 @@ pub struct InlayHint {
pub padding_left: bool,
pub padding_right: bool,
pub tooltip: Option<InlayHintTooltip>,
pub resolve_state: ResolveState,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ResolveState {
Resolved,
CanResolve(Option<lsp::LSPAny>),
Resolving,
}
impl Hash for ResolveState {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
// Regular `lsp::LSPAny` is not hashable, so we can't hash it.
// LSP expects this data to not to change between requests, so we only hash the discriminant.
std::mem::discriminant(self).hash(state);
}
}
impl InlayHint {