added more variable detections

This commit is contained in:
2024-06-08 18:59:46 +02:00
parent e82dae5dfc
commit ad00c78f0c
3 changed files with 116 additions and 12 deletions
+7 -1
View File
@@ -43,7 +43,7 @@ impl LspServer for Server {
);
let mut completion_items: Vec<CompletionItem> = Vec::new();
for (name, var) in items {
let mut item = CompletionItem::new_simple(name, "mydetail".to_string());
let mut item = CompletionItem::new_simple(name, var.desc);
match var.vtype {
VariableType::Func => {
item.kind = Some(CompletionItemKind::FUNCTION);
@@ -54,6 +54,12 @@ impl LspServer for Server {
VariableType::Keyword => {
item.kind = Some(CompletionItemKind::KEYWORD);
}
VariableType::Struct => {
item.kind = Some(CompletionItemKind::STRUCT);
}
VariableType::Namespace => {
item.kind = Some(CompletionItemKind::MODULE);
}
}
completion_items.push(item);
}