mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-28 02:39:59 +00:00
[ty] Add type as detail to completion items (#20047)
## Summary @BurntSushi was so kind as to find me an easy task to do some coding before I'm off to PTO. This PR adds the type to completion items (see the gray little text at the end of a completion item). https://github.com/user-attachments/assets/c0a86061-fa12-47b4-b43c-3c646771a69d
This commit is contained in:
parent
0b6ce1c788
commit
5d217b7f46
3 changed files with 5 additions and 0 deletions
|
|
@ -425,6 +425,7 @@ impl Workspace {
|
|||
documentation: completion
|
||||
.documentation
|
||||
.map(|documentation| documentation.render_plaintext()),
|
||||
detail: completion.inner.ty.display(&self.db).to_string().into(),
|
||||
})
|
||||
.collect())
|
||||
}
|
||||
|
|
@ -914,6 +915,8 @@ pub struct Completion {
|
|||
pub kind: Option<CompletionKind>,
|
||||
#[wasm_bindgen(getter_with_clone)]
|
||||
pub documentation: Option<String>,
|
||||
#[wasm_bindgen(getter_with_clone)]
|
||||
pub detail: Option<String>,
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue