Merge pull request #2411 from zed-industries/rust-snippet-variable-completions

Avoid treating snippet completions' details as their variable types
This commit is contained in:
Max Brunsfeld 2023-04-25 08:59:35 -07:00 committed by GitHub
commit c31a5063d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -133,7 +133,8 @@ impl LspAdapter for RustLspAdapter {
});
}
Some(lsp::CompletionItemKind::CONSTANT | lsp::CompletionItemKind::VARIABLE)
if completion.detail.is_some() =>
if completion.detail.is_some()
&& completion.insert_text_format != Some(lsp::InsertTextFormat::SNIPPET) =>
{
let detail = completion.detail.as_ref().unwrap();
let name = &completion.label;