extension: Add support for labelDetails for LSP completions (#20144)

Closes #14278


be7336e92a/src/completion.rs (L419-L429)


be7336e92a/src/completion.rs (L555-L572)


Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This commit is contained in:
bangbangsheshotmedown 2024-11-04 16:02:19 +00:00 committed by GitHub
parent 1e944a51ff
commit 4bbddcad31
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 142 additions and 8 deletions

View file

@ -387,6 +387,7 @@ impl From<lsp::CompletionItem> for wit::Completion {
fn from(value: lsp::CompletionItem) -> Self {
Self {
label: value.label,
label_details: value.label_details.map(Into::into),
detail: value.detail,
kind: value.kind.map(Into::into),
insert_text_format: value.insert_text_format.map(Into::into),
@ -394,6 +395,15 @@ impl From<lsp::CompletionItem> for wit::Completion {
}
}
impl From<lsp::CompletionItemLabelDetails> for wit::CompletionLabelDetails {
fn from(value: lsp::CompletionItemLabelDetails) -> Self {
Self {
detail: value.detail,
description: value.description,
}
}
}
impl From<lsp::CompletionItemKind> for wit::CompletionKind {
fn from(value: lsp::CompletionItemKind) -> Self {
match value {