internal: better factoring for to_proto::completion

One source completion can produce up to two lsp completions.
Additionally, `preselct` and `sort_text` are global properties of the
whole set of completions, so the right granularity here is to convert
many completions.

As a side-benefit, we no loger allocate intermediate vec.
This commit is contained in:
Aleksey Kladov
2021-07-04 14:08:33 +03:00
parent 108b56f354
commit f34762abb7
4 changed files with 98 additions and 85 deletions

View File

@@ -499,3 +499,10 @@ pub enum WorkspaceSymbolSearchKind {
OnlyTypes,
AllSymbols,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct CompletionResolveData {
pub position: lsp_types::TextDocumentPositionParams,
pub full_import_path: String,
pub imported_name: String,
}