editor: Improve snippet completion to show key inline in completion and description as aside (#30603)

Closes #28028

Before:
<img width="742" alt="image"
src="https://github.com/user-attachments/assets/31723970-5420-40ea-a394-4ffa0038925c"
/>

After:
<img width="989" alt="image"
src="https://github.com/user-attachments/assets/0aebc317-a234-4e68-8304-cb479513af15"
/>


Release Notes:

- Improved snippet code completion to show key in completion menu and
description in aside.
This commit is contained in:
Smit Barmase 2025-05-12 16:58:59 -07:00 committed by GitHub
parent 229f3dab22
commit e5d497ee08
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 46 additions and 20 deletions

View file

@ -19872,9 +19872,15 @@ fn snippet_completions(
filter_range: 0..matching_prefix.len(),
},
icon_path: None,
documentation: snippet.description.clone().map(|description| {
CompletionDocumentation::SingleLine(description.into())
}),
documentation: Some(
CompletionDocumentation::SingleLineAndMultiLinePlainText {
single_line: snippet.name.clone().into(),
plain_text: snippet
.description
.clone()
.map(|description| description.into()),
},
),
insert_text_mode: None,
confirm: None,
})