From e4066fb6904f86fb64839c705c7e748f39e2ae98 Mon Sep 17 00:00:00 2001 From: psteinroe Date: Wed, 11 Dec 2024 22:27:02 +0100 Subject: [PATCH] setup taplo and unify + format toml files --- .cargo/config.toml | 2 +- Cargo.toml | 133 ++++++++++---------- clippy.toml | 1 - crates/pg_base_db/Cargo.toml | 18 ++- crates/pg_cli/Cargo.toml | 58 +++++---- crates/pg_commands/Cargo.toml | 20 ++- crates/pg_commands/src/execute_statement.rs | 4 +- crates/pg_completions/Cargo.toml | 20 ++- crates/pg_configuration/Cargo.toml | 33 ++--- crates/pg_console/Cargo.toml | 19 ++- crates/pg_diagnostics/Cargo.toml | 39 +++--- crates/pg_diagnostics/src/display.rs | 2 +- crates/pg_diagnostics_categories/Cargo.toml | 15 ++- crates/pg_diagnostics_macros/Cargo.toml | 14 ++- crates/pg_flags/Cargo.toml | 16 ++- crates/pg_fs/Cargo.toml | 35 +++--- crates/pg_hover/Cargo.toml | 22 ++-- crates/pg_inlay_hints/Cargo.toml | 28 +++-- crates/pg_inlay_hints/src/functions_args.rs | 16 +-- crates/pg_lexer/Cargo.toml | 19 ++- crates/pg_lexer_codegen/Cargo.toml | 21 ++-- crates/pg_lint/Cargo.toml | 28 +++-- crates/pg_lsp/Cargo.toml | 64 +++++----- crates/pg_lsp/src/session.rs | 2 +- crates/pg_lsp_converters/Cargo.toml | 20 ++- crates/pg_lsp_new/Cargo.toml | 46 ++++--- crates/pg_lsp_new/src/utils.rs | 2 +- crates/pg_markup/Cargo.toml | 14 ++- crates/pg_query_ext/Cargo.toml | 18 ++- crates/pg_query_ext_codegen/Cargo.toml | 19 ++- crates/pg_query_proto_parser/Cargo.toml | 18 ++- crates/pg_schema_cache/Cargo.toml | 18 ++- crates/pg_schema_cache/src/functions.rs | 4 +- crates/pg_schema_cache/src/tables.rs | 4 +- crates/pg_statement_splitter/Cargo.toml | 19 ++- crates/pg_syntax/Cargo.toml | 20 ++- crates/pg_test_utils/Cargo.toml | 27 ++-- crates/pg_text_edit/Cargo.toml | 21 ++-- crates/pg_type_resolver/Cargo.toml | 16 ++- crates/pg_type_resolver/src/functions.rs | 5 +- crates/pg_type_resolver/src/types.rs | 15 +-- crates/pg_typecheck/Cargo.toml | 22 ++-- crates/pg_workspace/Cargo.toml | 36 +++--- crates/pg_workspace/src/lib.rs | 7 +- crates/pg_workspace_new/Cargo.toml | 52 ++++---- crates/pg_workspace_new/src/settings.rs | 6 +- justfile | 4 +- lib/tree_sitter_sql/Cargo.toml | 2 +- rustfmt.toml | 1 - taplo.toml | 7 ++ xtask/Cargo.toml | 22 ++-- xtask/codegen/Cargo.toml | 6 +- xtask/codegen/src/generate_crate.rs | 4 +- xtask/codegen/src/lib.rs | 4 +- xtask/codegen/src/main.rs | 5 +- xtask/src/glue.rs | 1 - xtask/src/lib.rs | 1 - 57 files changed, 659 insertions(+), 436 deletions(-) create mode 100644 taplo.toml diff --git a/.cargo/config.toml b/.cargo/config.toml index c5974c53..7624b335 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,3 +1,3 @@ [alias] -snap = "insta test" +snap = "insta test" xtask = "run --package xtask --" diff --git a/Cargo.toml b/Cargo.toml index c1306c26..0f4a4195 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,80 +1,81 @@ [workspace] -members = [ - "crates/*", - "lib/*", - "xtask/codegen" -] +members = ["crates/*", "lib/*", "xtask/codegen"] resolver = "2" [workspace.package] -rust-version = "1.71" - - +authors = ["Supabase Communnity"] +categories = ["development-tools", "postgres", "supabase"] +edition = "2021" +homepage = "https://supabase.com/" +keywords = ["linter", "typechecker", "postgres", "language-server"] +license = "MIT" +repository = "https://github.com/supabase-community/postgres_lsp" +rust-version = "1.82.0" [workspace.dependencies] # supporting crates unrelated to postgres -line_index = { path = "./lib/line_index", version = "0.0.0" } -tree_sitter_sql = { path = "./lib/tree_sitter_sql", version = "0.0.0" } -tree-sitter = "0.20.10" -schemars = { version = "0.8.21", features = ["indexmap2", "smallvec"] } -serde = "1.0.195" -serde_json = "1.0.114" -proc-macro2 = "1.0.66" -termcolor = "1.4.1" -unicode-width = "0.1.12" -text-size = "1.1.1" -enumflags2 = "0.7.10" -similar = "2.6.0" -quote = "1.0.33" -syn = "1.0.109" -indexmap = { version = "2.6.0", features = ["serde"] } -crossbeam = "0.8.4" -rayon = "1.10.0" -rustc-hash = "2.0.0" +anyhow = "1.0.92" biome_deserialize = "0.6.0" -biome_deserialize_macros = "0.6.0" -toml = "0.8.19" -tracing = { version = "0.1.40", default-features = false, features = ["std"] } -tracing-subscriber = "0.3.18" -bpaf = { version = "0.9.15", features = ["derive"] } -tokio = "1.40.0" -ignore = "0.4.23" -anyhow = "1.0.92" -smallvec = { version = "1.13.2", features = ["union", "const_new", "serde"] } -tower-lsp = "0.20.0" -sqlx = { version = "0.8.2", features = [ "runtime-async-std", "tls-rustls", "postgres", "json" ] } +biome_deserialize_macros = "0.6.0" +bpaf = { version = "0.9.15", features = ["derive"] } +crossbeam = "0.8.4" +enumflags2 = "0.7.10" +ignore = "0.4.23" +indexmap = { version = "2.6.0", features = ["serde"] } +line_index = { path = "./lib/line_index", version = "0.0.0" } +proc-macro2 = "1.0.66" +quote = "1.0.33" +rayon = "1.10.0" +rustc-hash = "2.0.0" +schemars = { version = "0.8.21", features = ["indexmap2", "smallvec"] } +serde = "1.0.195" +serde_json = "1.0.114" +similar = "2.6.0" +smallvec = { version = "1.13.2", features = ["union", "const_new", "serde"] } +sqlx = { version = "0.8.2", features = ["runtime-async-std", "tls-rustls", "postgres", "json"] } +syn = "1.0.109" +termcolor = "1.4.1" +text-size = "1.1.1" +tokio = "1.40.0" +toml = "0.8.19" +tower-lsp = "0.20.0" +tracing = { version = "0.1.40", default-features = false, features = ["std"] } +tracing-subscriber = "0.3.18" +tree-sitter = "0.20.10" +tree_sitter_sql = { path = "./lib/tree_sitter_sql", version = "0.0.0" } +unicode-width = "0.1.12" # postgres specific crates -pg_flags = { path = "./crates/pg_flags", version = "0.0.0" } -pg_lexer = { path = "./crates/pg_lexer", version = "0.0.0" } -pg_lsp_new = { path = "./crates/pg_lsp_new", version = "0.0.0" } -pg_lsp_converters = { path = "./crates/pg_lsp_converters", version = "0.0.0" } -pg_cli = { path = "./crates/pg_cli", version = "0.0.0" } -pg_configuration = { path = "./crates/pg_configuration", version = "0.0.0" } -pg_markup = { path = "./crates/pg_markup", version = "0.0.0" } -pg_console = { path = "./crates/pg_console", version = "0.0.0" } -pg_text_edit = { path = "./crates/pg_text_edit", version = "0.0.0" } -pg_workspace_new = { path = "./crates/pg_workspace_new", version = "0.0.0" } -pg_fs = { path = "./crates/pg_fs", version = "0.0.0" } -pg_diagnostics = { path = "./crates/pg_diagnostics", version = "0.0.0" } -pg_diagnostics_macros = { path = "./crates/pg_diagnostics_macros", version = "0.0.0" } +pg_base_db = { path = "./crates/pg_base_db", version = "0.0.0" } +pg_cli = { path = "./crates/pg_cli", version = "0.0.0" } +pg_commands = { path = "./crates/pg_commands", version = "0.0.0" } +pg_completions = { path = "./crates/pg_completions", version = "0.0.0" } +pg_configuration = { path = "./crates/pg_configuration", version = "0.0.0" } +pg_console = { path = "./crates/pg_console", version = "0.0.0" } +pg_diagnostics = { path = "./crates/pg_diagnostics", version = "0.0.0" } pg_diagnostics_categories = { path = "./crates/pg_diagnostics_categories", version = "0.0.0" } -pg_lexer_codegen = { path = "./crates/pg_lexer_codegen", version = "0.0.0" } -pg_statement_splitter = { path = "./crates/pg_statement_splitter", version = "0.0.0" } -pg_query_ext = { path = "./crates/pg_query_ext", version = "0.0.0" } -pg_query_ext_codegen = { path = "./crates/pg_query_ext_codegen", version = "0.0.0" } -pg_syntax = { path = "./crates/pg_syntax", version = "0.0.0" } -pg_schema_cache = { path = "./crates/pg_schema_cache", version = "0.0.0" } -pg_commands = { path = "./crates/pg_commands", version = "0.0.0" } -pg_completions = { path = "./crates/pg_completions", version = "0.0.0" } -pg_base_db = { path = "./crates/pg_base_db", version = "0.0.0" } -pg_query_proto_parser = { path = "./crates/pg_query_proto_parser", version = "0.0.0" } -pg_typecheck = { path = "./crates/pg_typecheck", version = "0.0.0" } -pg_type_resolver = { path = "./crates/pg_type_resolver", version = "0.0.0" } -pg_hover = { path = "./crates/pg_hover", version = "0.0.0" } -pg_inlay_hints = { path = "./crates/pg_inlay_hints", version = "0.0.0" } -pg_lint = { path = "./crates/pg_lint", version = "0.0.0" } -pg_workspace = { path = "./crates/pg_workspace", version = "0.0.0" } +pg_diagnostics_macros = { path = "./crates/pg_diagnostics_macros", version = "0.0.0" } +pg_flags = { path = "./crates/pg_flags", version = "0.0.0" } +pg_fs = { path = "./crates/pg_fs", version = "0.0.0" } +pg_hover = { path = "./crates/pg_hover", version = "0.0.0" } +pg_inlay_hints = { path = "./crates/pg_inlay_hints", version = "0.0.0" } +pg_lexer = { path = "./crates/pg_lexer", version = "0.0.0" } +pg_lexer_codegen = { path = "./crates/pg_lexer_codegen", version = "0.0.0" } +pg_lint = { path = "./crates/pg_lint", version = "0.0.0" } +pg_lsp_converters = { path = "./crates/pg_lsp_converters", version = "0.0.0" } +pg_lsp_new = { path = "./crates/pg_lsp_new", version = "0.0.0" } +pg_markup = { path = "./crates/pg_markup", version = "0.0.0" } +pg_query_ext = { path = "./crates/pg_query_ext", version = "0.0.0" } +pg_query_ext_codegen = { path = "./crates/pg_query_ext_codegen", version = "0.0.0" } +pg_query_proto_parser = { path = "./crates/pg_query_proto_parser", version = "0.0.0" } +pg_schema_cache = { path = "./crates/pg_schema_cache", version = "0.0.0" } +pg_statement_splitter = { path = "./crates/pg_statement_splitter", version = "0.0.0" } +pg_syntax = { path = "./crates/pg_syntax", version = "0.0.0" } +pg_text_edit = { path = "./crates/pg_text_edit", version = "0.0.0" } +pg_type_resolver = { path = "./crates/pg_type_resolver", version = "0.0.0" } +pg_typecheck = { path = "./crates/pg_typecheck", version = "0.0.0" } +pg_workspace = { path = "./crates/pg_workspace", version = "0.0.0" } +pg_workspace_new = { path = "./crates/pg_workspace_new", version = "0.0.0" } pg_test_utils = { path = "./crates/pg_test_utils" } # parser = { path = "./crates/parser", version = "0.0.0" } diff --git a/clippy.toml b/clippy.toml index 6dae5352..4296655a 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1,2 +1 @@ allow-dbg-in-tests = true - diff --git a/crates/pg_base_db/Cargo.toml b/crates/pg_base_db/Cargo.toml index 25dbf8e6..1afa91c4 100644 --- a/crates/pg_base_db/Cargo.toml +++ b/crates/pg_base_db/Cargo.toml @@ -1,14 +1,22 @@ [package] -name = "pg_base_db" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_base_db" +repository.workspace = true +version = "0.0.0" + [dependencies] -text-size.workspace = true line_index.workspace = true +text-size.workspace = true +pg_fs.workspace = true pg_statement_splitter.workspace = true -pg_fs.workspace = true [dev-dependencies] diff --git a/crates/pg_cli/Cargo.toml b/crates/pg_cli/Cargo.toml index 1008a7ea..bbeab8ec 100644 --- a/crates/pg_cli/Cargo.toml +++ b/crates/pg_cli/Cargo.toml @@ -1,33 +1,41 @@ [package] -name = "pg_cli" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_cli" +repository.workspace = true +version = "0.0.0" + [dependencies] +anyhow = { workspace = true } +bpaf = { workspace = true, features = ["bright-color"] } +crossbeam = { workspace = true } +dashmap = "5.5.3" +hdrhistogram = { version = "7.5.4", default-features = false } +path-absolutize = { version = "3.1.1", optional = false, features = ["use_unix_paths_on_wasm"] } +pg_configuration = { workspace = true } pg_console = { workspace = true } -pg_flags = { workspace = true } -pg_configuration = { workspace = true } -pg_fs = { workspace = true } +pg_diagnostics = { workspace = true } +pg_flags = { workspace = true } +pg_fs = { workspace = true } pg_lsp_new = { workspace = true } -pg_workspace_new = { workspace = true } -pg_text_edit = { workspace = true } -path-absolutize = { version = "3.1.1", optional = false, features = ["use_unix_paths_on_wasm"] } -pg_diagnostics = { workspace = true } -crossbeam = { workspace = true } -bpaf = { workspace = true, features = ["bright-color"] } -rayon = { workspace = true } -quick-junit = "0.5.0" -tracing = { workspace = true } -tracing-appender = "0.2.3" -tracing-subscriber = { workspace = true, features = ["env-filter", "json"] } -tracing-tree = "0.4.0" -hdrhistogram = { version = "7.5.4", default-features = false } -rustc-hash = { workspace = true } -tokio = { workspace = true, features = ["io-std", "io-util", "net", "time", "rt", "sync", "rt-multi-thread", "macros"] } -anyhow = { workspace = true } -dashmap = "5.5.3" -serde = { workspace = true, features = ["derive"] } -serde_json = { workspace = true } +pg_text_edit = { workspace = true } +pg_workspace_new = { workspace = true } +quick-junit = "0.5.0" +rayon = { workspace = true } +rustc-hash = { workspace = true } +serde = { workspace = true, features = ["derive"] } +serde_json = { workspace = true } +tokio = { workspace = true, features = ["io-std", "io-util", "net", "time", "rt", "sync", "rt-multi-thread", "macros"] } +tracing = { workspace = true } +tracing-appender = "0.2.3" +tracing-subscriber = { workspace = true, features = ["env-filter", "json"] } +tracing-tree = "0.4.0" [target.'cfg(unix)'.dependencies] libc = "0.2.161" diff --git a/crates/pg_commands/Cargo.toml b/crates/pg_commands/Cargo.toml index b5a24250..85808e13 100644 --- a/crates/pg_commands/Cargo.toml +++ b/crates/pg_commands/Cargo.toml @@ -1,13 +1,21 @@ [package] -name = "pg_commands" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_commands" +repository.workspace = true +version = "0.0.0" + [dependencies] +anyhow = "1.0.62" +async-std = "1.12.0" +sqlx.workspace = true text-size.workspace = true -async-std = "1.12.0" -anyhow = "1.0.62" -sqlx.workspace = true [lib] doctest = false diff --git a/crates/pg_commands/src/execute_statement.rs b/crates/pg_commands/src/execute_statement.rs index 619791a5..ba71b481 100644 --- a/crates/pg_commands/src/execute_statement.rs +++ b/crates/pg_commands/src/execute_statement.rs @@ -15,9 +15,7 @@ impl ExecuteStatementCommand { if let Some(conn) = conn { match conn.execute(self.statement.as_str()).await { Ok(res) => Ok(res), - Err(e) => { - Err(anyhow::anyhow!(e.to_string())) - } + Err(e) => Err(anyhow::anyhow!(e.to_string())), } } else { Err(anyhow::anyhow!("No connection to database".to_string())) diff --git a/crates/pg_completions/Cargo.toml b/crates/pg_completions/Cargo.toml index ba0e981c..b62cca3b 100644 --- a/crates/pg_completions/Cargo.toml +++ b/crates/pg_completions/Cargo.toml @@ -1,17 +1,25 @@ [package] -name = "pg_completions" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_completions" +repository.workspace = true +version = "0.0.0" + [dependencies] async-std = "1.12.0" text-size.workspace = true -tree-sitter.workspace = true -tree_sitter_sql.workspace = true pg_schema_cache.workspace = true -pg_test_utils.workspace = true +pg_test_utils.workspace = true +tree-sitter.workspace = true +tree_sitter_sql.workspace = true sqlx.workspace = true diff --git a/crates/pg_configuration/Cargo.toml b/crates/pg_configuration/Cargo.toml index 2a1151e8..13139916 100644 --- a/crates/pg_configuration/Cargo.toml +++ b/crates/pg_configuration/Cargo.toml @@ -1,25 +1,30 @@ [package] -name = "pg_configuration" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_configuration" +repository.workspace = true +version = "0.0.0" + [dependencies] +biome_deserialize = { workspace = true } +biome_deserialize_macros = { workspace = true } +bpaf = { workspace = true } +pg_console = { workspace = true } +pg_diagnostics = { workspace = true } schemars = { workspace = true, features = ["indexmap1"], optional = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true, features = ["raw_value"] } -biome_deserialize = { workspace = true } -text-size = { workspace = true } -biome_deserialize_macros = { workspace = true } -bpaf = { workspace = true } -pg_diagnostics = { workspace = true } -pg_console = { workspace = true } -toml = { workspace = true } +text-size = { workspace = true } +toml = { workspace = true } [lib] doctest = false [features] -schema = [ - "dep:schemars" -] - +schema = ["dep:schemars"] diff --git a/crates/pg_console/Cargo.toml b/crates/pg_console/Cargo.toml index 03f6905c..56dc4ad0 100644 --- a/crates/pg_console/Cargo.toml +++ b/crates/pg_console/Cargo.toml @@ -1,11 +1,19 @@ [package] -name = "pg_console" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_console" +repository.workspace = true +version = "0.0.0" + [dependencies] -pg_markup = { workspace = true } -text-size = { workspace = true } +pg_markup = { workspace = true } +text-size = { workspace = true } schemars = { workspace = true, optional = true } serde = { workspace = true, optional = true, features = ["derive"] } @@ -21,4 +29,3 @@ serde_markup = ["serde", "schemars"] [lib] doctest = false - diff --git a/crates/pg_diagnostics/Cargo.toml b/crates/pg_diagnostics/Cargo.toml index 626291d2..d082710f 100644 --- a/crates/pg_diagnostics/Cargo.toml +++ b/crates/pg_diagnostics/Cargo.toml @@ -1,22 +1,30 @@ [package] -name = "pg_diagnostics" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_diagnostics" +repository.workspace = true +version = "0.0.0" + [dependencies] -backtrace = "0.3.74" -text-size.workspace = true -pg_diagnostics_macros = { workspace = true } -pg_diagnostics_categories = { workspace = true, features = ["serde"] } +backtrace = "0.3.74" +bpaf = { workspace = true } +enumflags2 = { workspace = true } pg_console = { workspace = true, features = ["serde_markup"] } -pg_text_edit = { workspace = true } -bpaf = { workspace = true } -serde = { workspace = true, features = ["derive"] } -enumflags2 = { workspace = true } -termcolor = { workspace = true } -unicode-width = { workspace = true } -serde_json = { workspace = true } -schemars = { workspace = true, optional = true } +pg_diagnostics_categories = { workspace = true, features = ["serde"] } +pg_diagnostics_macros = { workspace = true } +pg_text_edit = { workspace = true } +schemars = { workspace = true, optional = true } +serde = { workspace = true, features = ["derive"] } +serde_json = { workspace = true } +termcolor = { workspace = true } +text-size.workspace = true +unicode-width = { workspace = true } [features] schema = ["schemars", "pg_text_edit/schemars", "pg_diagnostics_categories/schemars"] @@ -25,4 +33,3 @@ schema = ["schemars", "pg_text_edit/schemars", "pg_diagnostics_categories/schema [lib] doctest = false - diff --git a/crates/pg_diagnostics/src/display.rs b/crates/pg_diagnostics/src/display.rs index 1707b777..e3b7a7ba 100644 --- a/crates/pg_diagnostics/src/display.rs +++ b/crates/pg_diagnostics/src/display.rs @@ -669,8 +669,8 @@ mod tests { use pg_diagnostics::{DiagnosticTags, Severity}; use pg_diagnostics_categories::{category, Category}; use pg_text_edit::TextEdit; - use text_size::{TextRange, TextSize}; use serde_json::{from_value, json}; + use text_size::{TextRange, TextSize}; use crate::{self as pg_diagnostics}; use crate::{ diff --git a/crates/pg_diagnostics_categories/Cargo.toml b/crates/pg_diagnostics_categories/Cargo.toml index 01258c09..bfb7be43 100644 --- a/crates/pg_diagnostics_categories/Cargo.toml +++ b/crates/pg_diagnostics_categories/Cargo.toml @@ -1,7 +1,15 @@ [package] -name = "pg_diagnostics_categories" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_diagnostics_categories" +repository.workspace = true +version = "0.0.0" + [dependencies] schemars = { workspace = true, optional = true } @@ -9,4 +17,3 @@ serde = { workspace = true, optional = true } [build-dependencies] quote = "1.0.14" - diff --git a/crates/pg_diagnostics_macros/Cargo.toml b/crates/pg_diagnostics_macros/Cargo.toml index 764e5dc6..e67067be 100644 --- a/crates/pg_diagnostics_macros/Cargo.toml +++ b/crates/pg_diagnostics_macros/Cargo.toml @@ -1,7 +1,15 @@ [package] -name = "pg_diagnostics_macros" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_diagnostics_macros" +repository.workspace = true +version = "0.0.0" + [lib] proc-macro = true diff --git a/crates/pg_flags/Cargo.toml b/crates/pg_flags/Cargo.toml index e5cf6365..17277a3a 100644 --- a/crates/pg_flags/Cargo.toml +++ b/crates/pg_flags/Cargo.toml @@ -1,10 +1,18 @@ [package] -name = "pg_flags" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_flags" +repository.workspace = true +version = "0.0.0" + [dependencies] -pg_console = { workspace = true } +pg_console = { workspace = true } [dev-dependencies] diff --git a/crates/pg_fs/Cargo.toml b/crates/pg_fs/Cargo.toml index 5022fcaa..691322d7 100644 --- a/crates/pg_fs/Cargo.toml +++ b/crates/pg_fs/Cargo.toml @@ -1,20 +1,28 @@ [package] -name = "pg_fs" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_fs" +repository.workspace = true +version = "0.0.0" + [dependencies] -directories = "5.0.1" -tracing = { workspace = true } -serde = { workspace = true } -parking_lot = { version = "0.12.3", features = ["arc_lock"] } -rayon = { workspace = true } -rustc-hash = { workspace = true } +crossbeam = { workspace = true } +directories = "5.0.1" +enumflags2 = { workspace = true } +parking_lot = { version = "0.12.3", features = ["arc_lock"] } pg_diagnostics = { workspace = true } -crossbeam = { workspace = true } -smallvec = { workspace = true } -enumflags2 = { workspace = true } -schemars = { workspace = true, optional = true } +rayon = { workspace = true } +rustc-hash = { workspace = true } +schemars = { workspace = true, optional = true } +serde = { workspace = true } +smallvec = { workspace = true } +tracing = { workspace = true } [features] serde = ["schemars", "pg_diagnostics/schema"] @@ -23,4 +31,3 @@ serde = ["schemars", "pg_diagnostics/schema"] [lib] doctest = false - diff --git a/crates/pg_hover/Cargo.toml b/crates/pg_hover/Cargo.toml index 6b9a46f4..61af3bcd 100644 --- a/crates/pg_hover/Cargo.toml +++ b/crates/pg_hover/Cargo.toml @@ -1,14 +1,22 @@ [package] -name = "pg_hover" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_hover" +repository.workspace = true +version = "0.0.0" + [dependencies] -text-size.workspace = true -pg_query_ext.workspace = true +pg_query_ext.workspace = true pg_schema_cache.workspace = true -pg_syntax.workspace = true -tree-sitter.workspace = true +pg_syntax.workspace = true +text-size.workspace = true +tree-sitter.workspace = true tree_sitter_sql.workspace = true [dev-dependencies] diff --git a/crates/pg_inlay_hints/Cargo.toml b/crates/pg_inlay_hints/Cargo.toml index 68a660dc..3a272eec 100644 --- a/crates/pg_inlay_hints/Cargo.toml +++ b/crates/pg_inlay_hints/Cargo.toml @@ -1,17 +1,25 @@ [package] -name = "pg_inlay_hints" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_inlay_hints" +repository.workspace = true +version = "0.0.0" + [dependencies] -text-size.workspace = true -pg_query_ext.workspace = true -pg_schema_cache.workspace = true +pg_query_ext.workspace = true +pg_schema_cache.workspace = true +pg_syntax.workspace = true pg_type_resolver.workspace = true -pg_syntax.workspace = true -tree-sitter.workspace = true -tree_sitter_sql.workspace = true -sqlx.workspace = true +sqlx.workspace = true +text-size.workspace = true +tree-sitter.workspace = true +tree_sitter_sql.workspace = true [dev-dependencies] async-std = "1.12.0" diff --git a/crates/pg_inlay_hints/src/functions_args.rs b/crates/pg_inlay_hints/src/functions_args.rs index ffd896b9..c6e13e3b 100644 --- a/crates/pg_inlay_hints/src/functions_args.rs +++ b/crates/pg_inlay_hints/src/functions_args.rs @@ -25,14 +25,14 @@ impl InlayHintsResolver for FunctionArgHint { ChildrenIterator::new(root.to_owned()) .filter_map(|n| match n { pg_query_ext::NodeEnum::FuncCall(source_fn) => { - pg_type_resolver::resolve_func_call( - source_fn.as_ref(), - params.schema_cache, - ).map(|schema_fn| resolve_func_arg_hint( - source_fn.as_ref(), - schema_fn, - params.schema_cache, - )) + pg_type_resolver::resolve_func_call(source_fn.as_ref(), params.schema_cache) + .map(|schema_fn| { + resolve_func_arg_hint( + source_fn.as_ref(), + schema_fn, + params.schema_cache, + ) + }) } _ => None, }) diff --git a/crates/pg_lexer/Cargo.toml b/crates/pg_lexer/Cargo.toml index 33f5dd88..30d8b45b 100644 --- a/crates/pg_lexer/Cargo.toml +++ b/crates/pg_lexer/Cargo.toml @@ -1,20 +1,27 @@ [package] -name = "pg_lexer" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_lexer" +repository.workspace = true +version = "0.0.0" + [dependencies] regex = "1.9.1" -pg_query = "0.8" pg_lexer_codegen.workspace = true +pg_query = "0.8" +cstree = { version = "0.12.0", features = ["derive"] } text-size.workspace = true -cstree = { version = "0.12.0", features = ["derive"] } [dev-dependencies] insta = "1.31.0" [lib] doctest = false - diff --git a/crates/pg_lexer_codegen/Cargo.toml b/crates/pg_lexer_codegen/Cargo.toml index 809a66f0..854919cd 100644 --- a/crates/pg_lexer_codegen/Cargo.toml +++ b/crates/pg_lexer_codegen/Cargo.toml @@ -1,14 +1,21 @@ [package] -name = "pg_lexer_codegen" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_lexer_codegen" +repository.workspace = true +version = "0.0.0" + [dependencies] -proc-macro2.workspace = true -quote = "1.0.33" pg_query_proto_parser.workspace = true +proc-macro2.workspace = true +quote = "1.0.33" [lib] -doctest = false +doctest = false proc-macro = true - diff --git a/crates/pg_lint/Cargo.toml b/crates/pg_lint/Cargo.toml index 9cb28142..a4f59389 100644 --- a/crates/pg_lint/Cargo.toml +++ b/crates/pg_lint/Cargo.toml @@ -1,17 +1,25 @@ [package] -name = "pg_lint" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_lint" +repository.workspace = true +version = "0.0.0" + [dependencies] -text-size.workspace = true -pg_base_db.workspace = true +lazy_static = "1.4.0" +pg_base_db.workspace = true pg_query_ext.workspace = true -pg_syntax.workspace = true -serde_plain = "1.0" -serde.workspace = true -lazy_static = "1.4.0" -serde_json.workspace = true +pg_syntax.workspace = true +serde.workspace = true +serde_json.workspace = true +serde_plain = "1.0" +text-size.workspace = true [dev-dependencies] diff --git a/crates/pg_lsp/Cargo.toml b/crates/pg_lsp/Cargo.toml index 947eaf28..861051ab 100644 --- a/crates/pg_lsp/Cargo.toml +++ b/crates/pg_lsp/Cargo.toml @@ -1,7 +1,15 @@ [package] -name = "pg_lsp" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_lsp" +repository.workspace = true +version = "0.0.0" + [[bin]] name = "pglsp" @@ -9,35 +17,35 @@ path = "src/main.rs" test = false [dependencies] -lsp-server = "0.7.6" -crossbeam-channel = "0.5.12" -async-channel = "2.3.1" -lsp-types = "0.95.0" -serde.workspace = true +anyhow = "1.0.81" +async-channel = "2.3.1" +async-std = "1.12.0" +crossbeam-channel = "0.5.12" +dashmap = "5.5.3" +lsp-server = "0.7.6" +lsp-types = "0.95.0" +serde.workspace = true serde_json.workspace = true -anyhow = "1.0.81" -async-std = "1.12.0" -threadpool = "1.8.1" -dashmap = "5.5.3" -text-size.workspace = true +text-size.workspace = true +threadpool = "1.8.1" line_index.workspace = true -sqlx.workspace = true -tower-lsp.workspace = true - -pg_hover.workspace = true -pg_fs.workspace = true -pg_completions.workspace = true -pg_inlay_hints.workspace = true -pg_commands.workspace = true -pg_base_db.workspace = true +sqlx.workspace = true +tower-lsp.workspace = true + +pg_base_db.workspace = true +pg_commands.workspace = true +pg_completions.workspace = true +pg_diagnostics.workspace = true +pg_fs.workspace = true +pg_hover.workspace = true +pg_inlay_hints.workspace = true pg_schema_cache.workspace = true -pg_workspace.workspace = true -pg_diagnostics.workspace = true -tokio = { version = "1.40.0", features = ["io-std", "macros", "rt-multi-thread", "sync", "time"] } -tokio-util = "0.7.12" -tracing = "0.1.40" -tracing-subscriber = "0.3.18" +pg_workspace.workspace = true +tokio = { version = "1.40.0", features = ["io-std", "macros", "rt-multi-thread", "sync", "time"] } +tokio-util = "0.7.12" +tracing = "0.1.40" +tracing-subscriber = "0.3.18" [dev-dependencies] diff --git a/crates/pg_lsp/src/session.rs b/crates/pg_lsp/src/session.rs index d3ac532a..c9b634c4 100644 --- a/crates/pg_lsp/src/session.rs +++ b/crates/pg_lsp/src/session.rs @@ -3,9 +3,9 @@ use std::{collections::HashSet, sync::Arc}; use pg_base_db::{Change, DocumentChange}; use pg_commands::{Command, ExecuteStatementCommand}; use pg_completions::CompletionParams; -use pg_workspace::diagnostics::Diagnostic; use pg_fs::PgLspPath; use pg_hover::HoverParams; +use pg_workspace::diagnostics::Diagnostic; use pg_workspace::Workspace; use text_size::TextSize; use tokio::sync::RwLock; diff --git a/crates/pg_lsp_converters/Cargo.toml b/crates/pg_lsp_converters/Cargo.toml index beec78c4..e4e7e285 100644 --- a/crates/pg_lsp_converters/Cargo.toml +++ b/crates/pg_lsp_converters/Cargo.toml @@ -1,13 +1,21 @@ [package] -name = "pg_lsp_converters" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_lsp_converters" +repository.workspace = true +version = "0.0.0" + [dependencies] -anyhow = { workspace = true } -rustc-hash = { workspace = true } -tower-lsp = { version = "0.20.0" } +anyhow = { workspace = true } +rustc-hash = { workspace = true } text-size.workspace = true +tower-lsp = { version = "0.20.0" } [dev-dependencies] diff --git a/crates/pg_lsp_new/Cargo.toml b/crates/pg_lsp_new/Cargo.toml index db1bbeb4..e9d1b30f 100644 --- a/crates/pg_lsp_new/Cargo.toml +++ b/crates/pg_lsp_new/Cargo.toml @@ -1,26 +1,34 @@ [package] -name = "pg_lsp_new" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_lsp_new" +repository.workspace = true +version = "0.0.0" + [dependencies] -futures = "0.3.31" -anyhow = { workspace = true } -rustc-hash = { workspace = true } -serde = { workspace = true, features = ["derive"] } -serde_json = { workspace = true } -tokio = { workspace = true, features = ["rt", "io-std"] } -tower-lsp = { version = "0.20.0" } -tracing = { workspace = true, features = ["attributes"] } -pg_lsp_converters = { workspace = true } -pg_console = { workspace = true } -pg_diagnostics = { workspace = true } -pg_configuration = { workspace = true } -pg_fs = { workspace = true } -pg_workspace_new = { workspace = true } -pg_text_edit = { workspace = true } -biome_deserialize = { workspace = true } +anyhow = { workspace = true } +biome_deserialize = { workspace = true } +futures = "0.3.31" +pg_configuration = { workspace = true } +pg_console = { workspace = true } +pg_diagnostics = { workspace = true } +pg_fs = { workspace = true } +pg_lsp_converters = { workspace = true } +pg_text_edit = { workspace = true } +pg_workspace_new = { workspace = true } +rustc-hash = { workspace = true } +serde = { workspace = true, features = ["derive"] } +serde_json = { workspace = true } text-size.workspace = true +tokio = { workspace = true, features = ["rt", "io-std"] } +tower-lsp = { version = "0.20.0" } +tracing = { workspace = true, features = ["attributes"] } [dev-dependencies] diff --git a/crates/pg_lsp_new/src/utils.rs b/crates/pg_lsp_new/src/utils.rs index 10010ac3..fb0bd196 100644 --- a/crates/pg_lsp_new/src/utils.rs +++ b/crates/pg_lsp_new/src/utils.rs @@ -10,8 +10,8 @@ use pg_text_edit::{CompressedOp, DiffOp, TextEdit}; use std::any::Any; use std::borrow::Cow; use std::fmt::{Debug, Display}; -use std::ops::{Add, Range}; use std::io; +use std::ops::{Add, Range}; use text_size::{TextRange, TextSize}; use tower_lsp::jsonrpc::Error as LspError; use tower_lsp::lsp_types; diff --git a/crates/pg_markup/Cargo.toml b/crates/pg_markup/Cargo.toml index f0a61552..2b76998e 100644 --- a/crates/pg_markup/Cargo.toml +++ b/crates/pg_markup/Cargo.toml @@ -1,7 +1,15 @@ [package] -name = "pg_markup" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_markup" +repository.workspace = true +version = "0.0.0" + [dependencies] proc-macro-error = { version = "1.0.4", default-features = false } diff --git a/crates/pg_query_ext/Cargo.toml b/crates/pg_query_ext/Cargo.toml index a169947b..8e9868e9 100644 --- a/crates/pg_query_ext/Cargo.toml +++ b/crates/pg_query_ext/Cargo.toml @@ -1,14 +1,22 @@ [package] -name = "pg_query_ext" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_query_ext" +repository.workspace = true +version = "0.0.0" + [dependencies] -pg_query = "0.8" petgraph = "0.6.4" +pg_query = "0.8" +pg_lexer.workspace = true pg_query_ext_codegen.workspace = true -pg_lexer.workspace = true [lib] doctest = false diff --git a/crates/pg_query_ext_codegen/Cargo.toml b/crates/pg_query_ext_codegen/Cargo.toml index 88f57540..9098a4d5 100644 --- a/crates/pg_query_ext_codegen/Cargo.toml +++ b/crates/pg_query_ext_codegen/Cargo.toml @@ -1,15 +1,22 @@ [package] -name = "pg_query_ext_codegen" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_query_ext_codegen" +repository.workspace = true +version = "0.0.0" + [dependencies] proc-macro2.workspace = true -quote.workspace = true +quote.workspace = true pg_query_proto_parser.workspace = true [lib] +doctest = false proc-macro = true -doctest = false - diff --git a/crates/pg_query_proto_parser/Cargo.toml b/crates/pg_query_proto_parser/Cargo.toml index 9509fa4a..b63496d2 100644 --- a/crates/pg_query_proto_parser/Cargo.toml +++ b/crates/pg_query_proto_parser/Cargo.toml @@ -1,14 +1,20 @@ [package] -name = "pg_query_proto_parser" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_query_proto_parser" +repository.workspace = true +version = "0.0.0" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +convert_case = "0.6.0" +protobuf = "3.3.0" protobuf-parse = "3.3.0" -protobuf = "3.3.0" -convert_case = "0.6.0" [lib] doctest = false diff --git a/crates/pg_schema_cache/Cargo.toml b/crates/pg_schema_cache/Cargo.toml index c1061b5f..16baad99 100644 --- a/crates/pg_schema_cache/Cargo.toml +++ b/crates/pg_schema_cache/Cargo.toml @@ -1,11 +1,19 @@ [package] -name = "pg_schema_cache" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_schema_cache" +repository.workspace = true +version = "0.0.0" + [dependencies] -async-std = { version = "1.12.0" } -serde.workspace = true +async-std = { version = "1.12.0" } +serde.workspace = true serde_json.workspace = true sqlx.workspace = true diff --git a/crates/pg_schema_cache/src/functions.rs b/crates/pg_schema_cache/src/functions.rs index 42f9ca87..4813de4c 100644 --- a/crates/pg_schema_cache/src/functions.rs +++ b/crates/pg_schema_cache/src/functions.rs @@ -4,8 +4,7 @@ use sqlx::PgPool; use crate::schema_cache::SchemaCacheItem; -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -#[derive(Default)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)] pub enum Behavior { Immutable, Stable, @@ -13,7 +12,6 @@ pub enum Behavior { Volatile, } - impl From> for Behavior { fn from(s: Option) -> Self { match s { diff --git a/crates/pg_schema_cache/src/tables.rs b/crates/pg_schema_cache/src/tables.rs index 3ca5802e..60a1ff0f 100644 --- a/crates/pg_schema_cache/src/tables.rs +++ b/crates/pg_schema_cache/src/tables.rs @@ -2,8 +2,7 @@ use sqlx::PgPool; use crate::schema_cache::SchemaCacheItem; -#[derive(Debug, Clone, PartialEq, Eq)] -#[derive(Default)] +#[derive(Debug, Clone, PartialEq, Eq, Default)] pub enum ReplicaIdentity { #[default] Default, @@ -12,7 +11,6 @@ pub enum ReplicaIdentity { Nothing, } - impl From for ReplicaIdentity { fn from(s: String) -> Self { match s.as_str() { diff --git a/crates/pg_statement_splitter/Cargo.toml b/crates/pg_statement_splitter/Cargo.toml index e7023fb7..697ce8dc 100644 --- a/crates/pg_statement_splitter/Cargo.toml +++ b/crates/pg_statement_splitter/Cargo.toml @@ -1,13 +1,20 @@ [package] -name = "pg_statement_splitter" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_statement_splitter" +repository.workspace = true +version = "0.0.0" + [dependencies] -pg_lexer.workspace = true +pg_lexer.workspace = true text-size.workspace = true [dev-dependencies] +ntest = "0.9.3" pg_query = "0.8" -ntest = "0.9.3" - diff --git a/crates/pg_syntax/Cargo.toml b/crates/pg_syntax/Cargo.toml index d3ed2393..52cb7e1d 100644 --- a/crates/pg_syntax/Cargo.toml +++ b/crates/pg_syntax/Cargo.toml @@ -1,17 +1,25 @@ [package] -name = "pg_syntax" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_syntax" +repository.workspace = true +version = "0.0.0" + [dependencies] petgraph = "0.6.4" -cstree = { version = "0.12.0", features = ["derive"] } +cstree = { version = "0.12.0", features = ["derive"] } text-size.workspace = true +pg_lexer.workspace = true pg_query_ext.workspace = true -pg_lexer.workspace = true [dev-dependencies] +insta = "1.31.0" pg_query = "0.8" -insta = "1.31.0" diff --git a/crates/pg_test_utils/Cargo.toml b/crates/pg_test_utils/Cargo.toml index ce4eb139..ea837793 100644 --- a/crates/pg_test_utils/Cargo.toml +++ b/crates/pg_test_utils/Cargo.toml @@ -1,19 +1,26 @@ +[package] +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_test_utils" +repository.workspace = true +version = "0.0.0" + + [[bin]] name = "tree_print" path = "src/bin/tree_print.rs" -[package] -name = "pg_test_utils" -version = "0.0.0" -edition = "2021" - [dependencies] anyhow = "1.0.81" -uuid = { version = "1.11.0", features = ["v4"] } +clap = { version = "4.5.23", features = ["derive"] } dotenv = "0.15.0" -clap = { version = "4.5.23", features = ["derive"] } +uuid = { version = "1.11.0", features = ["v4"] } -sqlx.workspace = true -tree-sitter.workspace = true +sqlx.workspace = true +tree-sitter.workspace = true tree_sitter_sql.workspace = true - diff --git a/crates/pg_text_edit/Cargo.toml b/crates/pg_text_edit/Cargo.toml index 706a8b8f..2a1803f7 100644 --- a/crates/pg_text_edit/Cargo.toml +++ b/crates/pg_text_edit/Cargo.toml @@ -1,13 +1,21 @@ [package] -name = "pg_text_edit" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_text_edit" +repository.workspace = true +version = "0.0.0" + [dependencies] +schemars = { workspace = true, optional = true } +serde = { workspace = true, features = ["derive"] } +similar = { workspace = true, features = ["unicode"] } text-size = { workspace = true, features = ["serde"] } -similar = { workspace = true, features = ["unicode"] } -serde = { workspace = true, features = ["derive"] } -schemars = { workspace = true, optional = true } [features] schemars = ["dep:schemars"] @@ -16,4 +24,3 @@ schemars = ["dep:schemars"] [lib] doctest = false - diff --git a/crates/pg_type_resolver/Cargo.toml b/crates/pg_type_resolver/Cargo.toml index 757c3e3b..c75d80ad 100644 --- a/crates/pg_type_resolver/Cargo.toml +++ b/crates/pg_type_resolver/Cargo.toml @@ -1,10 +1,18 @@ [package] -name = "pg_type_resolver" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_type_resolver" +repository.workspace = true +version = "0.0.0" + [dependencies] -pg_query_ext.workspace = true +pg_query_ext.workspace = true pg_schema_cache.workspace = true [dev-dependencies] diff --git a/crates/pg_type_resolver/src/functions.rs b/crates/pg_type_resolver/src/functions.rs index 81fe3937..4256f716 100644 --- a/crates/pg_type_resolver/src/functions.rs +++ b/crates/pg_type_resolver/src/functions.rs @@ -78,10 +78,7 @@ fn function_matches( // can be any type } PossibleType::AnyOf(types) => { - if types - .iter() - .all(|type_id| *type_id != func_arg.type_id) - { + if types.iter().all(|type_id| *type_id != func_arg.type_id) { return false; } } diff --git a/crates/pg_type_resolver/src/types.rs b/crates/pg_type_resolver/src/types.rs index d3d35523..76a0d1e8 100644 --- a/crates/pg_type_resolver/src/types.rs +++ b/crates/pg_type_resolver/src/types.rs @@ -27,18 +27,15 @@ pub fn resolve_type(node: &pg_query_ext::NodeEnum, schema_cache: &SchemaCache) - .types .iter() .filter(|t| { - types.iter().any(|i| &i == &&t.name) - && t.schema == "pg_catalog" + types.iter().any(|i| &i == &&t.name) && t.schema == "pg_catalog" }) .map(|t| t.id) .collect(), ) } pg_query_ext::protobuf::a_const::Val::Fval(_) => { - let types: Vec = ["float4", "float8"] - .iter() - .map(|s| s.to_string()) - .collect(); + let types: Vec = + ["float4", "float8"].iter().map(|s| s.to_string()).collect(); PossibleType::AnyOf( schema_cache @@ -58,10 +55,8 @@ pub fn resolve_type(node: &pg_query_ext::NodeEnum, schema_cache: &SchemaCache) - .collect(), ), pg_query_ext::protobuf::a_const::Val::Sval(v) => { - let types: Vec = ["text", "varchar"] - .iter() - .map(|s| s.to_string()) - .collect(); + let types: Vec = + ["text", "varchar"].iter().map(|s| s.to_string()).collect(); PossibleType::AnyOf( schema_cache diff --git a/crates/pg_typecheck/Cargo.toml b/crates/pg_typecheck/Cargo.toml index 9e6e5b94..e238dd46 100644 --- a/crates/pg_typecheck/Cargo.toml +++ b/crates/pg_typecheck/Cargo.toml @@ -1,14 +1,22 @@ [package] -name = "pg_typecheck" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_typecheck" +repository.workspace = true +version = "0.0.0" + [dependencies] -pg_base_db.workspace = true +pg_base_db.workspace = true +pg_query_ext.workspace = true pg_schema_cache.workspace = true -pg_syntax.workspace = true -pg_query_ext.workspace = true -text-size.workspace = true +pg_syntax.workspace = true +text-size.workspace = true sqlx.workspace = true diff --git a/crates/pg_workspace/Cargo.toml b/crates/pg_workspace/Cargo.toml index 95fbbf3b..b5c31f43 100644 --- a/crates/pg_workspace/Cargo.toml +++ b/crates/pg_workspace/Cargo.toml @@ -1,25 +1,33 @@ [package] -name = "pg_workspace" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_workspace" +repository.workspace = true +version = "0.0.0" + [dependencies] -text-size = "1.1.1" -dashmap = "5.5.3" async-std = "1.12.0" +dashmap = "5.5.3" +text-size = "1.1.1" -pg_base_db.workspace = true -pg_fs.workspace = true -pg_query_ext.workspace = true -pg_lint.workspace = true -pg_syntax.workspace = true -pg_hover.workspace = true -pg_typecheck.workspace = true +pg_base_db.workspace = true +pg_fs.workspace = true +pg_hover.workspace = true +pg_lint.workspace = true +pg_query_ext.workspace = true pg_schema_cache.workspace = true +pg_syntax.workspace = true +pg_typecheck.workspace = true -tree-sitter.workspace = true +sqlx.workspace = true +tree-sitter.workspace = true tree_sitter_sql.workspace = true -sqlx.workspace = true [dev-dependencies] diff --git a/crates/pg_workspace/src/lib.rs b/crates/pg_workspace/src/lib.rs index b0f60de3..97c668d5 100644 --- a/crates/pg_workspace/src/lib.rs +++ b/crates/pg_workspace/src/lib.rs @@ -6,8 +6,8 @@ mod typecheck; use std::sync::{RwLock, RwLockWriteGuard}; -use diagnostics::{Diagnostic, Severity}; use dashmap::{DashMap, DashSet}; +use diagnostics::{Diagnostic, Severity}; use lint::Linter; use pg_base_db::{Document, DocumentChange, StatementRef}; use pg_fs::PgLspPath; @@ -192,7 +192,10 @@ mod tests { use pg_base_db::{Change, DocumentChange}; use text_size::{TextRange, TextSize}; - use crate::{diagnostics::{Diagnostic, Severity}, Workspace}; + use crate::{ + diagnostics::{Diagnostic, Severity}, + Workspace, + }; use pg_fs::PgLspPath; #[test] diff --git a/crates/pg_workspace_new/Cargo.toml b/crates/pg_workspace_new/Cargo.toml index 2c32ad8e..520271f3 100644 --- a/crates/pg_workspace_new/Cargo.toml +++ b/crates/pg_workspace_new/Cargo.toml @@ -1,29 +1,37 @@ [package] -name = "pg_workspace_new" -version = "0.0.0" -edition = "2021" +authors.workspace = true +categories.workspace = true +description = "" +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +name = "pg_workspace_new" +repository.workspace = true +version = "0.0.0" + [dependencies] -text-size.workspace = true -dashmap = "5.5.3" -sqlx.workspace = true -serde = { workspace = true, features = ["derive"] } -serde_json = { workspace = true, features = ["raw_value"] } -ignore = { workspace = true } -toml = { workspace = true } -pg_fs = { workspace = true, features = ["serde"] } -pg_diagnostics = { workspace = true } -biome_deserialize = "0.6.0" -pg_statement_splitter = { workspace = true } -pg_configuration = { workspace = true } -pg_query_ext = { workspace = true } -pg_console = { workspace = true } -pg_schema_cache = { workspace = true } -tracing = { workspace = true, features = ["attributes", "log"] } -tree-sitter.workspace = true +biome_deserialize = "0.6.0" +dashmap = "5.5.3" +futures = "0.3.31" +ignore = { workspace = true } +pg_configuration = { workspace = true } +pg_console = { workspace = true } +pg_diagnostics = { workspace = true } +pg_fs = { workspace = true, features = ["serde"] } +pg_query_ext = { workspace = true } +pg_schema_cache = { workspace = true } +pg_statement_splitter = { workspace = true } +serde = { workspace = true, features = ["derive"] } +serde_json = { workspace = true, features = ["raw_value"] } +sqlx.workspace = true +text-size.workspace = true +tokio = { workspace = true } +toml = { workspace = true } +tracing = { workspace = true, features = ["attributes", "log"] } +tree-sitter.workspace = true tree_sitter_sql.workspace = true -tokio = { workspace = true } -futures = "0.3.31" [dev-dependencies] diff --git a/crates/pg_workspace_new/src/settings.rs b/crates/pg_workspace_new/src/settings.rs index c1b83712..d3abacdd 100644 --- a/crates/pg_workspace_new/src/settings.rs +++ b/crates/pg_workspace_new/src/settings.rs @@ -7,10 +7,8 @@ use std::{ use ignore::gitignore::{Gitignore, GitignoreBuilder}; use pg_configuration::{ - database::PartialDatabaseConfiguration, - diagnostics::InvalidIgnorePattern, - files::FilesConfiguration, - ConfigurationDiagnostic, PartialConfiguration, + database::PartialDatabaseConfiguration, diagnostics::InvalidIgnorePattern, + files::FilesConfiguration, ConfigurationDiagnostic, PartialConfiguration, }; use pg_fs::FileSystem; diff --git a/justfile b/justfile index cbaec957..d6e71ab6 100644 --- a/justfile +++ b/justfile @@ -66,8 +66,8 @@ upgrade-tools: # Format Rust files and TOML files format: - cargo format - # taplo format + cargo fmt + taplo format [unix] _touch file: diff --git a/lib/tree_sitter_sql/Cargo.toml b/lib/tree_sitter_sql/Cargo.toml index 797af669..0a0f6e2e 100644 --- a/lib/tree_sitter_sql/Cargo.toml +++ b/lib/tree_sitter_sql/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" build = "build.rs" [build-dependencies] -cc="*" +cc = "*" [dependencies] tree-sitter.workspace = true diff --git a/rustfmt.toml b/rustfmt.toml index d6970839..43d4840c 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,2 +1 @@ newline_style = "Unix" - diff --git a/taplo.toml b/taplo.toml new file mode 100644 index 00000000..c11e58c2 --- /dev/null +++ b/taplo.toml @@ -0,0 +1,7 @@ +include = ["Cargo.toml", "crates/**/Cargo.toml", ".cargo/config.toml", "xtask/**/*.toml", "knope.toml"] +exclude = ["./benchmark/**/*.toml"] + +[formatting] +align_entries = true +column_width = 120 +reorder_keys = true diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index 9118df95..fe2e0ec6 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -1,17 +1,17 @@ [package] -name = "xtask" -version = "0.0.0" -publish = false -license = "MIT OR Apache-2.0" -edition = "2021" +edition = "2021" +license = "MIT OR Apache-2.0" +name = "xtask" +publish = false rust-version.workspace = true +version = "0.0.0" [dependencies] -anyhow = "1.0.62" -flate2 = "1.0.24" +anyhow = "1.0.62" +flate2 = "1.0.24" +time = { version = "0.3", default-features = false } write-json = "0.1.2" -xshell = "0.2.2" -xflags = "0.3.0" -time = { version = "0.3", default-features = false } -zip = { version = "0.6", default-features = false, features = ["deflate", "time"] } +xflags = "0.3.0" +xshell = "0.2.2" +zip = { version = "0.6", default-features = false, features = ["deflate", "time"] } # Avoid adding more dependencies to this crate diff --git a/xtask/codegen/Cargo.toml b/xtask/codegen/Cargo.toml index 65d71e99..7c5ba92b 100644 --- a/xtask/codegen/Cargo.toml +++ b/xtask/codegen/Cargo.toml @@ -5,7 +5,5 @@ publish = false version = "0.0.0" [dependencies] -bpaf = { workspace = true, features = ["derive"] } -xtask = { path = '../', version = "0.0" } - - +bpaf = { workspace = true, features = ["derive"] } +xtask = { path = '../', version = "0.0" } diff --git a/xtask/codegen/src/generate_crate.rs b/xtask/codegen/src/generate_crate.rs index 5fc46488..0b92e82e 100644 --- a/xtask/codegen/src/generate_crate.rs +++ b/xtask/codegen/src/generate_crate.rs @@ -16,8 +16,7 @@ name = "{name}" repository.workspace = true version = "0.0.0" -[lints] -workspace = true + "# ) } @@ -61,4 +60,3 @@ pub fn generate_crate(crate_name: String) -> Result<()> { // fs::write(knope_config, knope_contents)?; Ok(()) } - diff --git a/xtask/codegen/src/lib.rs b/xtask/codegen/src/lib.rs index 59c83805..d16bc644 100644 --- a/xtask/codegen/src/lib.rs +++ b/xtask/codegen/src/lib.rs @@ -2,8 +2,8 @@ mod generate_crate; -use bpaf::Bpaf; pub use self::generate_crate::generate_crate; +use bpaf::Bpaf; #[derive(Debug, Clone, Bpaf)] #[bpaf(options)] @@ -16,5 +16,3 @@ pub enum TaskCommand { name: String, }, } - - diff --git a/xtask/codegen/src/main.rs b/xtask/codegen/src/main.rs index ff7b871c..5d6246cc 100644 --- a/xtask/codegen/src/main.rs +++ b/xtask/codegen/src/main.rs @@ -1,8 +1,6 @@ use xtask::{project_root, pushd, Result}; -use xtask_codegen::{ - generate_crate, task_command, TaskCommand, -}; +use xtask_codegen::{generate_crate, task_command, TaskCommand}; fn main() -> Result<()> { let _d = pushd(project_root()); @@ -16,4 +14,3 @@ fn main() -> Result<()> { Ok(()) } - diff --git a/xtask/src/glue.rs b/xtask/src/glue.rs index b09285c6..f8cdb782 100644 --- a/xtask/src/glue.rs +++ b/xtask/src/glue.rs @@ -211,4 +211,3 @@ impl Env { self.pushd_stack.last().unwrap() } } - diff --git a/xtask/src/lib.rs b/xtask/src/lib.rs index 7ad1ef14..4fc0fb73 100644 --- a/xtask/src/lib.rs +++ b/xtask/src/lib.rs @@ -75,4 +75,3 @@ pub fn ensure_rustfmt() -> Result<()> { } Ok(()) } -