summaryrefslogtreecommitdiff
path: root/src/ide
diff options
context:
space:
mode:
Diffstat (limited to 'src/ide')
-rw-r--r--src/ide/complete.rs9
-rw-r--r--src/ide/highlight.rs1
2 files changed, 6 insertions, 4 deletions
diff --git a/src/ide/complete.rs b/src/ide/complete.rs
index da9e0725..0c80c8df 100644
--- a/src/ide/complete.rs
+++ b/src/ide/complete.rs
@@ -1096,7 +1096,9 @@ impl<'a> CompletionContext<'a> {
let mut sibling = Some(node.clone());
while let Some(node) = &sibling {
if let Some(v) = node.cast::<ast::LetBinding>() {
- defined.insert(v.binding().take());
+ for ident in v.kind().idents() {
+ defined.insert(ident.take());
+ }
}
sibling = node.prev_sibling();
}
@@ -1105,10 +1107,9 @@ impl<'a> CompletionContext<'a> {
if let Some(v) = parent.cast::<ast::ForLoop>() {
if node.prev_sibling_kind() != Some(SyntaxKind::In) {
let pattern = v.pattern();
- if let Some(key) = pattern.key() {
- defined.insert(key.take());
+ for ident in pattern.idents() {
+ defined.insert(ident.take());
}
- defined.insert(pattern.value().take());
}
}
diff --git a/src/ide/highlight.rs b/src/ide/highlight.rs
index e948975b..cf8fdd10 100644
--- a/src/ide/highlight.rs
+++ b/src/ide/highlight.rs
@@ -246,6 +246,7 @@ pub fn highlight(node: &LinkedNode) -> Option<Tag> {
SyntaxKind::LoopBreak => None,
SyntaxKind::LoopContinue => None,
SyntaxKind::FuncReturn => None,
+ SyntaxKind::Pattern => None,
SyntaxKind::LineComment => Some(Tag::Comment),
SyntaxKind::BlockComment => Some(Tag::Comment),