Skip to content

Commit d010195

Browse files
committed
chore: merge main
2 parents b9b130c + 66da667 commit d010195

File tree

82 files changed

+389574
-423550
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+389574
-423550
lines changed

.github/workflows/pull_request.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,8 @@ jobs:
272272
run: cargo run -p xtask_codegen -- configuration
273273
- name: Run the bindings codegen
274274
run: cargo run -p xtask_codegen -- bindings
275+
- name: Run the splinter codegen
276+
run: cargo run -p xtask_codegen -- splinter
275277
- name: Run the docs codegen
276278
run: cargo run -p docs_codegen
277279
- name: Check for git diff -- run "just ready" if you see an error

.sqlx/query-02927e584e85871ba6f84c58e8b5e4454b2c36eaf034657d5d2d95633fb85bdb.json

Lines changed: 74 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.sqlx/query-425fc6118e76cea42cf256b3b0f11046dc8b77d84c94314a0ed0716e5803df69.json

Lines changed: 74 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.sqlx/query-b869d517301aaf69d382f092c09d5a53712d68afd273423f9310cd793586f532.json

Lines changed: 74 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AGENTS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@ cargo insta review
144144

145145
## Development Notes
146146

147+
### Code Quality Guidelines
148+
**IMPORTANT**: Always run `cargo clippy --all-targets --all-features` and fix all warnings after making code changes. Clippy warnings must be resolved before committing code to maintain code quality standards.
149+
150+
### Git Commit and PR Guidelines
151+
**IMPORTANT**: NEVER add "Claude" or any AI assistant name to commit messages or pull request descriptions. Commits and PRs should appear as authored by the human developer only.
152+
147153
### Code Generation
148154
Many parser structures are generated from PostgreSQL's protobuf definitions using procedural macros in `pgls_query_macros`. Run `just gen-lint` after modifying analyzer rules or configurations.
149155

Cargo.lock

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ pgls_query = { path = "./crates/pgls_query", version = "0.0.0"
8282
pgls_query_ext = { path = "./crates/pgls_query_ext", version = "0.0.0" }
8383
pgls_query_macros = { path = "./crates/pgls_query_macros", version = "0.0.0" }
8484
pgls_schema_cache = { path = "./crates/pgls_schema_cache", version = "0.0.0" }
85+
pgls_splinter = { path = "./crates/pgls_splinter", version = "0.0.0" }
8586
pgls_statement_splitter = { path = "./crates/pgls_statement_splitter", version = "0.0.0" }
8687
pgls_suppressions = { path = "./crates/pgls_suppressions", version = "0.0.0" }
8788
pgls_text_edit = { path = "./crates/pgls_text_edit", version = "0.0.0" }

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Install: [instructions](https://pg-language-server.com/#installation)
1212
- [VSCode](https://marketplace.visualstudio.com/items?itemName=Supabase.postgrestools)
1313
- [Neovim](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#postgres_lsp)
1414
- [Zed](https://github.com/LoamStudios/zed-postgres-language-server)
15+
- [Sublime Text](https://lsp.sublimetext.io/language_servers/#postgresql)
1516

1617
## Overview
1718
LSP Demo | CLI Demo

crates/pgls_completions/src/providers/columns.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ mod tests {
5858
use crate::{
5959
CompletionItem, CompletionItemKind, complete,
6060
test_helper::{
61-
CompletionAssertion, assert_complete_results, assert_no_complete_results,
62-
get_test_deps, get_test_params,
61+
CompletionAssertion, assert_complete_results, get_test_deps, get_test_params,
6362
},
6463
};
6564

@@ -717,18 +716,6 @@ mod tests {
717716
&pool,
718717
)
719718
.await;
720-
721-
// no completions in the values list!
722-
assert_no_complete_results(
723-
format!(
724-
"insert into instruments (id, name) values ({})",
725-
QueryWithCursorPosition::cursor_marker()
726-
)
727-
.as_str(),
728-
None,
729-
&pool,
730-
)
731-
.await;
732719
}
733720

734721
#[sqlx::test(migrator = "pgls_test_utils::MIGRATIONS")]

crates/pgls_completions/src/providers/helper.rs

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use pgls_text_size::{TextRange, TextSize};
1+
use pgls_text_size::TextRange;
22
use pgls_treesitter::TreesitterContext;
33

44
use crate::{is_sanitized_token_with_quote, remove_sanitized_token};
@@ -9,29 +9,25 @@ pub(crate) fn node_text_surrounded_by_quotes(ctx: &TreesitterContext) -> bool {
99
}
1010

1111
pub(crate) fn get_range_to_replace(ctx: &TreesitterContext) -> TextRange {
12-
match ctx.node_under_cursor.as_ref() {
13-
Some(node) => {
14-
let content = ctx.get_node_under_cursor_content().unwrap_or("".into());
15-
let content = content.as_str();
12+
let node = &ctx.node_under_cursor;
13+
let content = ctx.get_node_under_cursor_content().unwrap_or("".into());
14+
let content = content.as_str();
1615

17-
let sanitized = remove_sanitized_token(content);
18-
let length = sanitized.len();
16+
let sanitized = remove_sanitized_token(content);
17+
let length = sanitized.len();
1918

20-
let mut start = node.start_byte();
21-
let mut end = start + length;
19+
let mut start = node.start_byte();
20+
let mut end = start + length;
2221

23-
if sanitized.starts_with('"') && sanitized.ends_with('"') {
24-
start += 1;
22+
if sanitized.starts_with('"') && sanitized.ends_with('"') {
23+
start += 1;
2524

26-
if sanitized.len() > 1 {
27-
end -= 1;
28-
}
29-
}
30-
31-
TextRange::new(start.try_into().unwrap(), end.try_into().unwrap())
25+
if sanitized.len() > 1 {
26+
end -= 1;
3227
}
33-
None => TextRange::empty(TextSize::new(0)),
3428
}
29+
30+
TextRange::new(start.try_into().unwrap(), end.try_into().unwrap())
3531
}
3632

3733
pub(crate) fn only_leading_quote(ctx: &TreesitterContext) -> bool {
@@ -45,7 +41,7 @@ pub(crate) fn with_schema_or_alias(
4541
item_name: &str,
4642
schema_or_alias_name: Option<&str>,
4743
) -> String {
48-
let is_already_prefixed_with_schema_name = ctx.schema_or_alias_name.is_some();
44+
let is_already_prefixed_with_schema_name = ctx.has_any_qualifier();
4945

5046
let with_quotes = node_text_surrounded_by_quotes(ctx);
5147
let single_leading_quote = only_leading_quote(ctx);

0 commit comments

Comments
 (0)