Skip to content

Commit 7b5b8c6

Browse files
ok…
1 parent 3b078a0 commit 7b5b8c6

File tree

4 files changed

+49
-88
lines changed

4 files changed

+49
-88
lines changed

crates/pgls_completions/src/providers/columns.rs

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -750,55 +750,55 @@ mod tests {
750750

751751
pool.execute(setup).await.unwrap();
752752

753-
// assert_complete_results(
754-
// format!(
755-
// "select name from instruments where {} ",
756-
// QueryWithCursorPosition::cursor_marker()
757-
// )
758-
// .as_str(),
759-
// vec![
760-
// CompletionAssertion::Label("created_at".into()),
761-
// CompletionAssertion::Label("id".into()),
762-
// CompletionAssertion::Label("name".into()),
763-
// CompletionAssertion::Label("z".into()),
764-
// ],
765-
// None,
766-
// &pool,
767-
// )
768-
// .await;
769-
770-
// assert_complete_results(
771-
// format!(
772-
// "select name from instruments where z = 'something' and created_at > {}",
773-
// QueryWithCursorPosition::cursor_marker()
774-
// )
775-
// .as_str(),
776-
// // simply do not complete columns + schemas; functions etc. are ok
777-
// vec![
778-
// CompletionAssertion::KindNotExists(CompletionItemKind::Column),
779-
// CompletionAssertion::KindNotExists(CompletionItemKind::Schema),
780-
// ],
781-
// None,
782-
// &pool,
783-
// )
784-
// .await;
785-
786-
// // prefers not mentioned columns
787-
// assert_complete_results(
788-
// format!(
789-
// "select name from instruments where id = 'something' and {}",
790-
// QueryWithCursorPosition::cursor_marker()
791-
// )
792-
// .as_str(),
793-
// vec![
794-
// CompletionAssertion::Label("created_at".into()),
795-
// CompletionAssertion::Label("name".into()),
796-
// CompletionAssertion::Label("z".into()),
797-
// ],
798-
// None,
799-
// &pool,
800-
// )
801-
// .await;
753+
assert_complete_results(
754+
format!(
755+
"select name from instruments where {} ",
756+
QueryWithCursorPosition::cursor_marker()
757+
)
758+
.as_str(),
759+
vec![
760+
CompletionAssertion::Label("created_at".into()),
761+
CompletionAssertion::Label("id".into()),
762+
CompletionAssertion::Label("name".into()),
763+
CompletionAssertion::Label("z".into()),
764+
],
765+
None,
766+
&pool,
767+
)
768+
.await;
769+
770+
assert_complete_results(
771+
format!(
772+
"select name from instruments where z = 'something' and created_at > {}",
773+
QueryWithCursorPosition::cursor_marker()
774+
)
775+
.as_str(),
776+
// simply do not complete columns + schemas; functions etc. are ok
777+
vec![
778+
CompletionAssertion::KindNotExists(CompletionItemKind::Column),
779+
CompletionAssertion::KindNotExists(CompletionItemKind::Schema),
780+
],
781+
None,
782+
&pool,
783+
)
784+
.await;
785+
786+
// prefers not mentioned columns
787+
assert_complete_results(
788+
format!(
789+
"select name from instruments where id = 'something' and {}",
790+
QueryWithCursorPosition::cursor_marker()
791+
)
792+
.as_str(),
793+
vec![
794+
CompletionAssertion::Label("created_at".into()),
795+
CompletionAssertion::Label("name".into()),
796+
CompletionAssertion::Label("z".into()),
797+
],
798+
None,
799+
&pool,
800+
)
801+
.await;
802802

803803
// uses aliases
804804
assert_complete_results(

crates/pgls_hover/tests/snapshots/column_hover.snap.new

Lines changed: 0 additions & 13 deletions
This file was deleted.

crates/pgls_hover/tests/snapshots/column_hover_quoted_schema_table.snap.new

Lines changed: 0 additions & 13 deletions
This file was deleted.

crates/pgls_hover/tests/snapshots/hover_type_in_select_clause.snap.new

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)