mirror of
https://github.com/hatoo/egglog-language-server.git
synced 2025-12-23 04:36:33 +00:00
fix
This commit is contained in:
parent
7ffb65ba46
commit
5fbc61a128
1 changed files with 9 additions and 10 deletions
|
|
@ -468,11 +468,12 @@ impl SrcTree {
|
|||
.collect();
|
||||
}
|
||||
}
|
||||
Vec::new()
|
||||
} else if node.parent().map(|p| p.kind()) == Some("variant") || is_inner(node, "schema") {
|
||||
// complete types
|
||||
let global_types = self.global_types();
|
||||
|
||||
return global_types
|
||||
global_types
|
||||
.iter()
|
||||
.map(|s| s.as_str())
|
||||
.chain(BUILTIN_TYPES.iter().copied())
|
||||
|
|
@ -481,12 +482,12 @@ impl SrcTree {
|
|||
kind: Some(CompletionItemKind::CLASS),
|
||||
..Default::default()
|
||||
})
|
||||
.collect();
|
||||
.collect()
|
||||
} else if node.prev_sibling().is_some() {
|
||||
// Triggered by space
|
||||
// Completion global variables
|
||||
let globals = self.globals_all();
|
||||
return globals
|
||||
globals
|
||||
.iter()
|
||||
.map(|s| s.as_str())
|
||||
.map(|s| CompletionItem {
|
||||
|
|
@ -494,7 +495,7 @@ impl SrcTree {
|
|||
kind: Some(CompletionItemKind::FUNCTION),
|
||||
..Default::default()
|
||||
})
|
||||
.collect();
|
||||
.collect()
|
||||
} else if is_root_command(node) {
|
||||
// Completion keywords
|
||||
const KEYWORDS: &[&str] = &[
|
||||
|
|
@ -534,7 +535,7 @@ impl SrcTree {
|
|||
|
||||
let globals = self.globals_all();
|
||||
|
||||
return KEYWORDS
|
||||
KEYWORDS
|
||||
.iter()
|
||||
.map(|k| CompletionItem {
|
||||
label: k.to_string(),
|
||||
|
|
@ -546,10 +547,10 @@ impl SrcTree {
|
|||
kind: Some(CompletionItemKind::FUNCTION),
|
||||
..Default::default()
|
||||
}))
|
||||
.collect();
|
||||
.collect()
|
||||
} else {
|
||||
let globals = self.globals_all();
|
||||
return globals
|
||||
globals
|
||||
.iter()
|
||||
.map(|s| s.as_str())
|
||||
.chain(BUILTIN.iter().copied())
|
||||
|
|
@ -563,10 +564,8 @@ impl SrcTree {
|
|||
kind: Some(CompletionItemKind::VARIABLE),
|
||||
..Default::default()
|
||||
}))
|
||||
.collect();
|
||||
.collect()
|
||||
}
|
||||
|
||||
Vec::new()
|
||||
}
|
||||
|
||||
pub fn includes(&self) -> Vec<String> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue