Skip to content

Commit 2afc5e0

Browse files
feat(completions): basic scoring algorithm for tables
1 parent 4ccda40 commit 2afc5e0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

crates/pg_completions/src/complete.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,14 @@ mod tests {
133133

134134
let result = complete(p);
135135

136-
// TODO: actually assert that we get good autocompletion suggestions
137136
assert!(result.items.len() > 0);
137+
138+
let best_match = &result.items[0];
139+
140+
assert_eq!(
141+
best_match.label, "users",
142+
"Does not return the expected table to autocomplete: {}",
143+
best_match.label
144+
)
138145
}
139146
}

0 commit comments

Comments
 (0)