LSP: properly classify callback aliases in auto-complete

Otherwise the completion is wrong as it tries to complete
with `:` instead of `=>`
This commit is contained in:
Olivier Goffart 2021-07-15 11:08:42 +02:00
parent ca53abdbc7
commit d7402be076

View file

@ -240,7 +240,7 @@ fn resolve_element_scope(
.into_iter()
.map(|(k, t)| {
let mut c = CompletionItem::new_simple(k, t.to_string());
c.kind = Some(if matches!(t, Type::Callback { .. }) {
c.kind = Some(if matches!(t, Type::InferredCallback | Type::Callback { .. }) {
CompletionItemKind::Method
} else {
CompletionItemKind::Property
@ -271,7 +271,7 @@ fn resolve_element_scope(
return None;
}
let mut c = CompletionItem::new_simple(k.into(), t.to_string());
c.kind = Some(if matches!(t, Type::Callback { .. }) {
c.kind = Some(if matches!(t, Type::InferredCallback | Type::Callback { .. }) {
CompletionItemKind::Method
} else {
CompletionItemKind::Property