mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 22:31:23 +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
|
@ -71,6 +71,7 @@ impl BackgroundDocumentRequestHandler for CompletionRequestHandler {
|
|||
label: comp.inner.name.into(),
|
||||
kind,
|
||||
sort_text: Some(format!("{i:-max_index_len$}")),
|
||||
detail: comp.inner.ty.display(db).to_string().into(),
|
||||
documentation: comp
|
||||
.documentation
|
||||
.map(|docstring| Documentation::String(docstring.render_plaintext())),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue