Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b70da98
intermediate, looks good but has some snapshot errors where we sugges…
juleswritescode Feb 6, 2026
86534ee
friggin epic
juleswritescode Feb 6, 2026
4c05291
set statement updates
juleswritescode Feb 6, 2026
8919011
figured that out
juleswritescode Feb 6, 2026
1bbc6fc
mucho bettero
juleswritescode Feb 6, 2026
48d8565
ok
juleswritescode Feb 6, 2026
8824f73
so far
juleswritescode Feb 6, 2026
faf7cc7
nice nice
juleswritescode Feb 7, 2026
84088ff
looks very good
juleswritescode Feb 7, 2026
533a755
getting there
juleswritescode Feb 7, 2026
80c5cd4
were doing amazing sweetie
juleswritescode Feb 7, 2026
e892bf7
very good
juleswritescode Feb 7, 2026
6a46224
so far!
juleswritescode Feb 7, 2026
c5775e8
i believe this is what they call a boo-yeah
juleswritescode Feb 7, 2026
880df55
so far?
juleswritescode Feb 7, 2026
d29519b
adjust assertions
juleswritescode Feb 13, 2026
069dce9
nice
juleswritescode Feb 13, 2026
475aadb
intermediate
juleswritescode Feb 13, 2026
29ca81c
eyy
juleswritescode Feb 13, 2026
f16f7f0
ok
juleswritescode Feb 13, 2026
787f19c
readied
juleswritescode Feb 13, 2026
ddb6a66
Merge branch 'main' of github.com:supabase-community/postgres-languag…
juleswritescode Feb 13, 2026
bca07ee
fix
juleswritescode Feb 20, 2026
d3feab6
dirty
juleswritescode Feb 20, 2026
39ab00f
more ready
juleswritescode Feb 20, 2026
ebbb8cf
ack
juleswritescode Feb 20, 2026
240f74c
what is HAPPENING
juleswritescode Feb 20, 2026
324e804
format codegen workspace.ts output
juleswritescode Feb 20, 2026
7bf7527
ack acka ck
juleswritescode Feb 20, 2026
cccfb3e
Merge branch 'main' of github.com:supabase-community/postgres-languag…
juleswritescode Feb 20, 2026
4aad712
what
juleswritescode Feb 20, 2026
a584a1d
format
juleswritescode Feb 20, 2026
3baf2a3
ack
juleswritescode Feb 20, 2026
9069459
format before lint
juleswritescode Feb 20, 2026
b9c88db
dang
juleswritescode Feb 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"include": ["packages/**/*"]
},
"formatter": {
"enabled": true,
"indentStyle": "tab"
"enabled": true
},
"organizeImports": {
"enabled": true
Expand Down
1 change: 1 addition & 0 deletions crates/pgls_completions/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ tree-sitter.workspace = true
[dev-dependencies]
criterion.workspace = true
insta.workspace = true
pgls_schema_cache = { workspace = true, features = ["db"] }
pgls_test_utils.workspace = true
regex = "1.12.2"
sqlx.workspace = true
Expand Down
76 changes: 65 additions & 11 deletions crates/pgls_completions/src/providers/keywords.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ pub static ALL_KEYWORDS: &[SqlKeyword] = &[
SqlKeyword::new("all"),
SqlKeyword::new("alter").starts_statement(),
SqlKeyword::new("always"),
SqlKeyword::new("analyze").starts_statement(),
SqlKeyword::new("analyze")
.starts_statement()
.require_prefix(),
SqlKeyword::new("and").require_prefix(),
SqlKeyword::new("any").require_prefix(),
SqlKeyword::new("array").require_prefix(),
Expand Down Expand Up @@ -123,7 +125,9 @@ pub static ALL_KEYWORDS: &[SqlKeyword] = &[
SqlKeyword::new("exclude"),
SqlKeyword::new("execute"),
SqlKeyword::new("exists").require_prefix(),
SqlKeyword::new("explain").starts_statement(),
SqlKeyword::new("explain")
.starts_statement()
.require_prefix(),
SqlKeyword::new("extended"),
SqlKeyword::new("extension"),
SqlKeyword::new("external"),
Expand Down Expand Up @@ -174,7 +178,7 @@ pub static ALL_KEYWORDS: &[SqlKeyword] = &[
SqlKeyword::new("interval").require_prefix(),
SqlKeyword::new("into"),
SqlKeyword::new("invoker"),
SqlKeyword::new("is"),
SqlKeyword::new("is").require_prefix(),
SqlKeyword::new("isolation"),
SqlKeyword::new("join"),
SqlKeyword::new("json"),
Expand Down Expand Up @@ -430,6 +434,14 @@ mod tests {
assert_complete_results(
query.as_str(),
vec![
CompletionAssertion::LabelAndKind(
"create".into(),
crate::CompletionItemKind::Keyword,
),
CompletionAssertion::LabelAndKind(
"drop".into(),
crate::CompletionItemKind::Keyword,
),
CompletionAssertion::LabelAndKind(
"insert".into(),
crate::CompletionItemKind::Keyword,
Expand Down Expand Up @@ -609,10 +621,13 @@ mod tests {

assert_complete_results(
query.as_str(),
vec![CompletionAssertion::LabelAndKind(
"from".into(),
crate::CompletionItemKind::Keyword,
)],
vec![
CompletionAssertion::LabelAndKind("for".into(), crate::CompletionItemKind::Keyword),
CompletionAssertion::LabelAndKind(
"from".into(),
crate::CompletionItemKind::Keyword,
),
],
Some(setup),
&pool,
)
Expand All @@ -635,10 +650,17 @@ mod tests {

assert_complete_results(
query.as_str(),
vec![CompletionAssertion::LabelAndKind(
"from".into(),
crate::CompletionItemKind::Keyword,
)],
vec![
CompletionAssertion::LabelAndKind(
"except".into(),
crate::CompletionItemKind::Keyword,
),
CompletionAssertion::LabelAndKind("for".into(), crate::CompletionItemKind::Keyword),
CompletionAssertion::LabelAndKind(
"from".into(),
crate::CompletionItemKind::Keyword,
),
],
Some(setup),
&pool,
)
Expand Down Expand Up @@ -685,6 +707,11 @@ mod tests {
"cross".into(),
crate::CompletionItemKind::Keyword,
),
CompletionAssertion::LabelAndKind(
"except".into(),
crate::CompletionItemKind::Keyword,
),
CompletionAssertion::LabelAndKind("for".into(), crate::CompletionItemKind::Keyword),
CompletionAssertion::LabelAndKind(
"full".into(),
crate::CompletionItemKind::Keyword,
Expand All @@ -697,6 +724,10 @@ mod tests {
"inner".into(),
crate::CompletionItemKind::Keyword,
),
CompletionAssertion::LabelAndKind(
"intersect".into(),
crate::CompletionItemKind::Keyword,
),
CompletionAssertion::LabelAndKind(
"join".into(),
crate::CompletionItemKind::Keyword,
Expand All @@ -713,10 +744,30 @@ mod tests {
"natural".into(),
crate::CompletionItemKind::Keyword,
),
CompletionAssertion::LabelAndKind(
"offset".into(),
crate::CompletionItemKind::Keyword,
),
CompletionAssertion::LabelAndKind(
"order".into(),
crate::CompletionItemKind::Keyword,
),
CompletionAssertion::LabelAndKind(
"right".into(),
crate::CompletionItemKind::Keyword,
),
CompletionAssertion::LabelAndKind(
"union".into(),
crate::CompletionItemKind::Keyword,
),
CompletionAssertion::LabelAndKind(
"where".into(),
crate::CompletionItemKind::Keyword,
),
CompletionAssertion::LabelAndKind(
"window".into(),
crate::CompletionItemKind::Keyword,
),
],
Some(setup),
&pool,
Expand Down Expand Up @@ -797,9 +848,12 @@ mod tests {
query.as_str(),
vec![
CompletionAssertion::LabelAndKind("cross".into(), CompletionItemKind::Keyword),
CompletionAssertion::LabelAndKind("except".into(), CompletionItemKind::Keyword),
CompletionAssertion::LabelAndKind("for".into(), CompletionItemKind::Keyword),
CompletionAssertion::LabelAndKind("full".into(), CompletionItemKind::Keyword),
CompletionAssertion::LabelAndKind("group".into(), CompletionItemKind::Keyword),
CompletionAssertion::LabelAndKind("inner".into(), CompletionItemKind::Keyword),
CompletionAssertion::LabelAndKind("intersect".into(), CompletionItemKind::Keyword),
CompletionAssertion::LabelAndKind("join".into(), CompletionItemKind::Keyword),
],
Some(setup),
Expand Down
39 changes: 35 additions & 4 deletions crates/pgls_completions/src/relevance/filtering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -629,10 +629,41 @@ mod tests {

assert_complete_results(
format!("select * {}", QueryWithCursorPosition::cursor_marker()).as_str(),
vec![CompletionAssertion::LabelAndKind(
"from".into(),
crate::CompletionItemKind::Keyword,
)],
vec![
CompletionAssertion::LabelAndKind(
"except".into(),
crate::CompletionItemKind::Keyword,
),
CompletionAssertion::LabelAndKind("for".into(), crate::CompletionItemKind::Keyword),
CompletionAssertion::LabelAndKind(
"from".into(),
crate::CompletionItemKind::Keyword,
),
CompletionAssertion::LabelAndKind(
"group".into(),
crate::CompletionItemKind::Keyword,
),
CompletionAssertion::LabelAndKind(
"intersect".into(),
crate::CompletionItemKind::Keyword,
),
CompletionAssertion::LabelAndKind(
"limit".into(),
crate::CompletionItemKind::Keyword,
),
CompletionAssertion::LabelAndKind(
"offset".into(),
crate::CompletionItemKind::Keyword,
),
CompletionAssertion::LabelAndKind(
"order".into(),
crate::CompletionItemKind::Keyword,
),
CompletionAssertion::LabelAndKind(
"union".into(),
crate::CompletionItemKind::Keyword,
),
],
None,
&pool,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ select email from users |

Results:
cross - cross (Keyword)
except - except (Keyword)
for - for (Keyword)
full - full (Keyword)
group - group (Keyword)
inner - inner (Keyword)
join - join (Keyword)

--------------

Expand Down Expand Up @@ -56,10 +56,11 @@ identity_generation - information_schema.columns.identity_generation (Column)
select email from users where id |

Results:
except - except (Keyword)
for - for (Keyword)
group - group (Keyword)
intersect - intersect (Keyword)
limit - limit (Keyword)
order - order (Keyword)
window - window (Keyword)

--------------

Expand All @@ -78,10 +79,10 @@ select email from users where id = 1|
select email from users where id = 1; |

Results:
create - create (Keyword)
drop - drop (Keyword)
insert - insert (Keyword)
reset - reset (Keyword)
select - select (Keyword)
set - set (Keyword)
truncate - truncate (Keyword)

--------------
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ select u.id, auth.posts.content from auth.users u join auth.posts p on p.user_id

Results:
cross - cross (Keyword)
except - except (Keyword)
for - for (Keyword)
full - full (Keyword)
group - group (Keyword)
inner - inner (Keyword)
join - join (Keyword)

--------------

Expand Down Expand Up @@ -98,10 +98,10 @@ uid - auth.users.uid (Column)
select u.id, auth.posts.content from auth.users u join auth.posts p on p.user_id = u.uid; |

Results:
create - create (Keyword)
drop - drop (Keyword)
insert - insert (Keyword)
reset - reset (Keyword)
select - select (Keyword)
set - set (Keyword)
truncate - truncate (Keyword)

--------------
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,20 @@ encoding - pg_catalog.pg_database.encoding (Column)
select "email" |

Results:
except - except (Keyword)
for - for (Keyword)
from - from (Keyword)
group - group (Keyword)
intersect - intersect (Keyword)

--------------

select "email" f|

Results:
for - for (Keyword)
from - from (Keyword)
offset - offset (Keyword)

--------------

Expand Down Expand Up @@ -140,10 +146,10 @@ select "email" from "private".u|
select "email" from "private".users; |

Results:
create - create (Keyword)
drop - drop (Keyword)
insert - insert (Keyword)
reset - reset (Keyword)
select - select (Keyword)
set - set (Keyword)
truncate - truncate (Keyword)

--------------
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,20 @@ select "pr"."e|"
select "pr"."email" |

Results:
except - except (Keyword)
for - for (Keyword)
from - from (Keyword)
group - group (Keyword)
intersect - intersect (Keyword)

--------------

select "pr"."email" f|

Results:
for - for (Keyword)
from - from (Keyword)
offset - offset (Keyword)

--------------

Expand Down Expand Up @@ -136,10 +142,10 @@ select "pr"."email" from private.users |

Results:
cross - cross (Keyword)
except - except (Keyword)
for - for (Keyword)
full - full (Keyword)
group - group (Keyword)
inner - inner (Keyword)
join - join (Keyword)

--------------

Expand All @@ -150,10 +156,10 @@ select "pr"."email" from private.users "pr" |

Results:
cross - cross (Keyword)
except - except (Keyword)
for - for (Keyword)
full - full (Keyword)
group - group (Keyword)
inner - inner (Keyword)
join - join (Keyword)

--------------

Expand Down
Loading
Loading