mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-28 02:39:59 +00:00
Fix incorrect lsp inlay hint type (#20044)
This commit is contained in:
parent
8b827c3c6c
commit
0e9d77e43a
5 changed files with 41 additions and 4 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue