Fix incorrect lsp inlay hint type (#20044)

This commit is contained in:
Matthew Mckee 2025-08-22 16:12:49 +01:00 committed by GitHub
parent 8b827c3c6c
commit 0e9d77e43a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 41 additions and 4 deletions

View file

@ -455,6 +455,7 @@ impl Workspace {
&source,
self.position_encoding,
),
kind: hint.content.into(),
})
.collect())
}
@ -977,6 +978,22 @@ impl From<ty_python_semantic::CompletionKind> for CompletionKind {
}
}
#[wasm_bindgen]
#[derive(Debug, Clone, PartialEq, Eq, Copy)]
pub enum InlayHintKind {
Type,
Parameter,
}
impl From<ty_ide::InlayHintContent<'_>> for InlayHintKind {
fn from(kind: ty_ide::InlayHintContent) -> Self {
match kind {
ty_ide::InlayHintContent::Type(_) => Self::Type,
ty_ide::InlayHintContent::CallArgumentName(_) => Self::Parameter,
}
}
}
#[wasm_bindgen]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct InlayHint {
@ -984,6 +1001,8 @@ pub struct InlayHint {
pub markdown: String,
pub position: Position,
pub kind: InlayHintKind,
}
#[wasm_bindgen]