Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
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
2 changes: 1 addition & 1 deletion .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
],
"deny": []
}
}
}
3 changes: 0 additions & 3 deletions .cursorignore

This file was deleted.

8 changes: 0 additions & 8 deletions .gitmodules

This file was deleted.

68 changes: 48 additions & 20 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace]
members = ["crates/*", "lib/*", "xtask/codegen", "xtask/rules_check", "docs/codegen"]
members = ["crates/*", "xtask/codegen", "xtask/rules_check", "docs/codegen"]
resolver = "2"

[workspace.package]
Expand Down Expand Up @@ -56,8 +56,7 @@ tokio = { version = "1.40.0", features = ["full"] }
tracing = { version = "0.1.40", default-features = false, features = ["std"] }
tracing-bunyan-formatter = { version = "0.3.10 " }
tracing-subscriber = "0.3.18"
tree-sitter = "0.20.10"
tree_sitter_sql = { path = "./lib/tree_sitter_sql", version = "0.0.0" }
tree-sitter = "0.25.9"
unicode-width = "0.1.12"

# postgres specific crates
Expand Down Expand Up @@ -88,6 +87,7 @@ pgt_text_edit = { path = "./crates/pgt_text_edit", version = "0.0.0
pgt_text_size = { path = "./crates/pgt_text_size", version = "0.0.0" }
pgt_tokenizer = { path = "./crates/pgt_tokenizer", version = "0.0.0" }
pgt_treesitter = { path = "./crates/pgt_treesitter", version = "0.0.0" }
pgt_treesitter_grammar = { path = "./crates/pgt_treesitter_grammar", version = "0.0.0" }
pgt_typecheck = { path = "./crates/pgt_typecheck", version = "0.0.0" }
pgt_workspace = { path = "./crates/pgt_workspace", version = "0.0.0" }
pgt_workspace_macros = { path = "./crates/pgt_workspace_macros", version = "0.0.0" }
Expand Down
14 changes: 7 additions & 7 deletions crates/pgt_completions/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ pgt_schema_cache.workspace = true
pgt_text_size.workspace = true
pgt_treesitter.workspace = true

fuzzy-matcher = "0.3.7"
schemars = { workspace = true, optional = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
tracing = { workspace = true }
tree-sitter.workspace = true
tree_sitter_sql.workspace = true
fuzzy-matcher = "0.3.7"
pgt_treesitter_grammar.workspace = true
schemars = { workspace = true, optional = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
tracing = { workspace = true }
tree-sitter.workspace = true

sqlx.workspace = true

Expand Down
4 changes: 3 additions & 1 deletion crates/pgt_completions/benches/sanitization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ fn sql_and_pos(sql: &str) -> (String, usize) {

fn get_tree(sql: &str) -> tree_sitter::Tree {
let mut parser = tree_sitter::Parser::new();
parser.set_language(tree_sitter_sql::language()).unwrap();
parser
.set_language(&pgt_treesitter_grammar::LANGUAGE.into())
.unwrap();
parser.parse(sql, None).unwrap()
}

Expand Down
7 changes: 4 additions & 3 deletions crates/pgt_completions/src/sanitization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ where

let mut parser = tree_sitter::Parser::new();
parser
.set_language(tree_sitter_sql::language())
.set_language(&pgt_treesitter_grammar::LANGUAGE.into())
.expect("Error loading sql language");
let tree = parser.parse(sql.clone(), None).unwrap();

Expand Down Expand Up @@ -314,7 +314,8 @@ mod tests {

fn get_test_params(input: &str, position: TextSize) -> CompletionParams {
let mut ts = tree_sitter::Parser::new();
ts.set_language(tree_sitter_sql::language()).unwrap();
ts.set_language(&pgt_treesitter_grammar::LANGUAGE.into())
.unwrap();

let tree = Box::new(ts.parse(input, None).unwrap());
let cache = Box::new(SchemaCache::default());
Expand Down Expand Up @@ -495,7 +496,7 @@ mod tests {

let mut parser = tree_sitter::Parser::new();
parser
.set_language(tree_sitter_sql::language())
.set_language(&pgt_treesitter_grammar::LANGUAGE.into())
.expect("Error loading sql language");

let tree = parser.parse(input, None).unwrap();
Expand Down
4 changes: 2 additions & 2 deletions crates/pgt_completions/src/test_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub(crate) async fn get_test_deps(

let mut parser = tree_sitter::Parser::new();
parser
.set_language(tree_sitter_sql::language())
.set_language(&pgt_treesitter_grammar::LANGUAGE.into())
.expect("Error loading sql language");

let tree = parser.parse(input.to_string(), None).unwrap();
Expand All @@ -48,7 +48,7 @@ pub(crate) async fn test_against_connection_string(

let mut parser = tree_sitter::Parser::new();
parser
.set_language(tree_sitter_sql::language())
.set_language(&pgt_treesitter_grammar::LANGUAGE.into())
.expect("Error loading sql language");

let tree = parser.parse(input.to_string(), None).unwrap();
Expand Down
26 changes: 13 additions & 13 deletions crates/pgt_hover/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ version = "0.0.0"


[dependencies]
humansize = { version = "2.1.3" }
pgt_query.workspace = true
pgt_schema_cache.workspace = true
pgt_text_size.workspace = true
pgt_treesitter.workspace = true
schemars = { workspace = true, optional = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
sqlx.workspace = true
tokio = { version = "1.41.1", features = ["full"] }
tracing = { workspace = true }
tree-sitter.workspace = true
tree_sitter_sql.workspace = true
humansize = { version = "2.1.3" }
pgt_query.workspace = true
pgt_schema_cache.workspace = true
pgt_text_size.workspace = true
pgt_treesitter.workspace = true
pgt_treesitter_grammar.workspace = true
schemars = { workspace = true, optional = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
sqlx.workspace = true
tokio = { version = "1.41.1", features = ["full"] }
tracing = { workspace = true }
tree-sitter.workspace = true

[dev-dependencies]
insta = { version = "1.42.1" }
Expand Down
4 changes: 3 additions & 1 deletion crates/pgt_hover/src/hoverables/test_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ pub(crate) fn create_test_context(query: QueryWithCursorPosition) -> TreesitterC
let (pos, sql) = query.get_text_and_position();

let mut parser = tree_sitter::Parser::new();
parser.set_language(tree_sitter_sql::language()).unwrap();
parser
.set_language(&pgt_treesitter_grammar::LANGUAGE.into())
.unwrap();
let tree = parser.parse(sql.clone(), None).unwrap();

// Leak some stuff so test setup is easier
Expand Down
2 changes: 1 addition & 1 deletion crates/pgt_hover/tests/hover_integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async fn test_hover_at_cursor(name: &str, query: String, setup: Option<&str>, te

let mut parser = tree_sitter::Parser::new();
parser
.set_language(tree_sitter_sql::language())
.set_language(&pgt_treesitter_grammar::LANGUAGE.into())
.expect("Error loading sql language");

let tree = parser.parse(&sql, None).unwrap();
Expand Down
6 changes: 3 additions & 3 deletions crates/pgt_test_utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ clap = { version = "4.5.23", features = ["derive"] }
dotenv = "0.15.0"
uuid = { version = "1.11.0", features = ["v4"] }

sqlx.workspace = true
tree-sitter.workspace = true
tree_sitter_sql.workspace = true
pgt_treesitter_grammar.workspace = true
sqlx.workspace = true
tree-sitter.workspace = true
5 changes: 3 additions & 2 deletions crates/pgt_test_utils/src/bin/tree_print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ fn main() {
let query = std::fs::read_to_string(&args.file).expect("Failed to read file.");

let mut parser = tree_sitter::Parser::new();
let lang = tree_sitter_sql::language();

parser.set_language(lang).expect("Setting Language failed.");
parser
.set_language(&pgt_treesitter_grammar::LANGUAGE.into())
.expect("Setting Language failed.");

let tree = parser
.parse(query.clone(), None)
Expand Down
Loading
Loading