Rename CompletionLabel to CodeLabel and add Project::symbols

This only works locally for now and we haven't implemented the
`RustLsp::label_for_symbol` method yet.
This commit is contained in:
Antonio Scandurra 2022-02-22 10:01:08 +01:00
parent 8f375a5026
commit 8a8ae0fbcd
7 changed files with 107 additions and 51 deletions

View file

@ -1,5 +1,5 @@
use crate::{
diagnostic_set::DiagnosticEntry, CodeAction, Completion, CompletionLabel, Diagnostic, Language,
diagnostic_set::DiagnosticEntry, CodeAction, CodeLabel, Completion, Diagnostic, Language,
Operation,
};
use anyhow::{anyhow, Result};
@ -421,7 +421,10 @@ pub fn deserialize_completion(
new_text: completion.new_text,
label: language
.and_then(|l| l.label_for_completion(&lsp_completion))
.unwrap_or(CompletionLabel::plain(&lsp_completion)),
.unwrap_or(CodeLabel::plain(
lsp_completion.label.clone(),
lsp_completion.filter_text.as_deref(),
)),
lsp_completion,
})
}