diff --git a/CHANGELOG.md b/CHANGELOG.md index bee1ca11..2f2f51f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,166 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## v2.54.0 - 2026-05-24 + +### Added + +- lexer: add parsing and erroring for num trailing suffix (#1159) + + ``` + error[syntax-error]: trailing junk after numeric literal + ╭▸ stdin:1:11 + │ + 1 │ SELECT 0x0y; + ╰╴ ━ + ``` + +- parser: warn about empty / invalid params & empty quoted idents (#1164) + + ``` + error[syntax-error]: empty delimited identifier + ╭▸ stdin:1:8 + │ + 1 │ select "", $, $2147483648 + ╰╴ ━━ + error[syntax-error]: missing parameter number + ╭▸ stdin:1:12 + │ + 1 │ select "", $, $2147483648 + ╰╴ ━ + error[syntax-error]: parameter number too large + ╭▸ stdin:1:15 + │ + 1 │ select "", $, $2147483648 + ╰╴ ━━━━━━━━━━━ + ``` + +- parser: warn about invalid octal/hex/binary digits (#1163) + + ``` + error[syntax-error]: invalid digit for a base 2 literal + ╭▸ stdin:1:12 + │ + 1 │ select 0b104, 0o7719, 0xg + ╰╴ ━ + error[syntax-error]: invalid digit for a base 8 literal + ╭▸ stdin:1:20 + │ + 1 │ select 0b104, 0o7719, 0xg + ╰╴ ━ + error[syntax-error]: trailing junk after numeric literal + ╭▸ stdin:1:25 + │ + 1 │ select 0b104, 0o7719, 0xg + ╰╴ ━ + ``` + +- parser: improve error reporting for malformed literals (#1162) + + ``` + error[syntax-error]: trailing junk after positional parameter + ╭▸ stdin:1:10 + │ + 1 │ SELECT $1a; + ╰╴ ━ + ``` + + instead of + + ``` + error[syntax-error]: trailing junk after positional parameter + ╭▸ stdin:1:10 + │ + 1 │ SELECT $1a; + ╰╴ ━━━ + ``` + +- parser: improve lexing numbers (#1161) + + ```sql + select .4; + ``` + + now produces: + + ``` + NUMERIC_NUMBER@7..9 ".4" + ``` + + instead of: + + ``` + INT_NUMBER@7..9 ".4" + ``` + +- ide: goto def for `t.c%type` (#1161) + + ```sql + create table t(a int, b text); + -- ^ dest + create function f(x t.a%type) returns s.t.b%type + -- ^ source + as $$ select 'hello'::text $$ language sql; + ``` + +- ide: find refs for types like `bit` (#1153) + + ```sql + create type pg_catalog.bit; + -- ^^^ source + + create function pg_catalog.bit(bigint, integer) returns bit + -- ^^^ ref + language internal; + ``` + +- ide: add hover for string literals (#1155) + + Now we decode the escape sequences for string literals on hover and show the + value up to the first new line. + +- ide: improve numeric literal type inference (#1156) + + ```sql + select 2147483647; -- type: integer + select 2147483648; -- type: bigint + select 100000000000000000000000; -- type: numeric + ``` + +- fmt: literals & binary operators (#1169) + + Format binary operators and literals. + + ```sql + -- before + select TRUE and FALSE; + select X'AF'; + + -- after + select true and false; + select + x'AF'; + ``` + +- fmt: unquote column aliases when possible (#1168) + + ```sql + -- before + select 1 as "foo"; + + -- after + select 1 as foo; + ``` + +### Changed + +- harden github action workflows (#1165). Thanks @chdsbd! + +### Fixed + +- lexer: fix unicode escape string issue (#1158) +- vscode: update TextMate grammar to support other numeric literal kinds (#1157) + ## v2.53.0 - 2026-05-17 ### Added diff --git a/Cargo.lock b/Cargo.lock index 92cd634f..cb12ab00 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2434,7 +2434,7 @@ dependencies = [ [[package]] name = "squawk" -version = "2.53.0" +version = "2.54.0" dependencies = [ "annotate-snippets", "anyhow", @@ -2465,7 +2465,7 @@ dependencies = [ [[package]] name = "squawk-fmt" -version = "2.53.0" +version = "2.54.0" dependencies = [ "anyhow", "camino", @@ -2481,7 +2481,7 @@ dependencies = [ [[package]] name = "squawk-github" -version = "2.53.0" +version = "2.54.0" dependencies = [ "jsonwebtoken", "log", @@ -2492,7 +2492,7 @@ dependencies = [ [[package]] name = "squawk-ide" -version = "2.53.0" +version = "2.54.0" dependencies = [ "annotate-snippets", "etcetera", @@ -2514,14 +2514,14 @@ dependencies = [ [[package]] name = "squawk-lexer" -version = "2.53.0" +version = "2.54.0" dependencies = [ "insta", ] [[package]] name = "squawk-linter" -version = "2.53.0" +version = "2.54.0" dependencies = [ "annotate-snippets", "enum-iterator", @@ -2536,7 +2536,7 @@ dependencies = [ [[package]] name = "squawk-parser" -version = "2.53.0" +version = "2.54.0" dependencies = [ "annotate-snippets", "camino", @@ -2549,7 +2549,7 @@ dependencies = [ [[package]] name = "squawk-server" -version = "2.53.0" +version = "2.54.0" dependencies = [ "anyhow", "crossbeam-channel", @@ -2575,7 +2575,7 @@ dependencies = [ [[package]] name = "squawk-syntax" -version = "2.53.0" +version = "2.54.0" dependencies = [ "annotate-snippets", "camino", @@ -2589,7 +2589,7 @@ dependencies = [ [[package]] name = "squawk-thread" -version = "2.53.0" +version = "2.54.0" dependencies = [ "crossbeam-channel", "crossbeam-utils", @@ -2601,7 +2601,7 @@ dependencies = [ [[package]] name = "squawk-wasm" -version = "2.53.0" +version = "2.54.0" dependencies = [ "console_error_panic_hook", "console_log", @@ -3477,7 +3477,7 @@ checksum = "32ac00cd3f8ec9c1d33fb3e7958a82df6989c42d747bd326c822b1d625283547" [[package]] name = "xtask" -version = "2.53.0" +version = "2.54.0" dependencies = [ "anyhow", "camino", diff --git a/Cargo.toml b/Cargo.toml index ad6a87a8..7c444ddf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ members = ["crates/*"] resolver = "2" [workspace.package] -version = "2.53.0" +version = "2.54.0" edition = "2024" rust-version = "1.94" authors = ["Squawk Team & Contributors"] @@ -79,14 +79,14 @@ rustc-hash = "2.1.1" # local # we have to make the versions explicit otherwise `cargo publish` won't work -squawk-github = { path = "./crates/squawk_github", version = "2.53.0" } -squawk-ide = { path = "./crates/squawk_ide", version = "2.53.0" } -squawk-lexer = { path = "./crates/squawk_lexer", version = "2.53.0" } -squawk-parser = { path = "./crates/squawk_parser", version = "2.53.0" } -squawk-syntax = { path = "./crates/squawk_syntax", version = "2.53.0" } -squawk-linter = { path = "./crates/squawk_linter", version = "2.53.0" } -squawk-server = { path = "./crates/squawk_server", version = "2.53.0" } -squawk-thread = { path = "./crates/squawk_thread", version = "2.53.0" } +squawk-github = { path = "./crates/squawk_github", version = "2.54.0" } +squawk-ide = { path = "./crates/squawk_ide", version = "2.54.0" } +squawk-lexer = { path = "./crates/squawk_lexer", version = "2.54.0" } +squawk-parser = { path = "./crates/squawk_parser", version = "2.54.0" } +squawk-syntax = { path = "./crates/squawk_syntax", version = "2.54.0" } +squawk-linter = { path = "./crates/squawk_linter", version = "2.54.0" } +squawk-server = { path = "./crates/squawk_server", version = "2.54.0" } +squawk-thread = { path = "./crates/squawk_thread", version = "2.54.0" } [workspace.lints.clippy] collapsible_else_if = "allow" diff --git a/README.md b/README.md index b6f12fbf..4cef9c32 100644 --- a/README.md +++ b/README.md @@ -265,7 +265,7 @@ to your project's `.pre-commit-config.yaml`: ```yaml repos: - repo: https://github.com/sbdchd/squawk - rev: 2.53.0 + rev: 2.54.0 hooks: - id: squawk files: path/to/postgres/migrations/written/in/sql diff --git a/crates/squawk_github/src/app.rs b/crates/squawk_github/src/app.rs index daa0cc18..68319517 100644 --- a/crates/squawk_github/src/app.rs +++ b/crates/squawk_github/src/app.rs @@ -11,7 +11,7 @@ use serde_json::Value; use std::time::Duration; use std::time::{SystemTime, UNIX_EPOCH}; -pub(crate) const SQUAWK_USER_AGENT: &str = "squawk/2.53.0"; +pub(crate) const SQUAWK_USER_AGENT: &str = "squawk/2.54.0"; #[derive(Debug, Serialize)] struct CommentBody { diff --git a/flake.nix b/flake.nix index 6e5c5c39..bc515bbf 100644 --- a/flake.nix +++ b/flake.nix @@ -18,7 +18,7 @@ { squawk = final.rustPlatform.buildRustPackage { pname = "squawk"; - version = "2.53.0"; + version = "2.54.0"; cargoLock = { lockFile = ./Cargo.lock; diff --git a/npm/darwin-arm64/package.json b/npm/darwin-arm64/package.json index feb14ba8..0b7a8568 100644 --- a/npm/darwin-arm64/package.json +++ b/npm/darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@squawk-cli/darwin-arm64", - "version": "2.53.0", + "version": "2.54.0", "description": "squawk-cli binary for darwin-arm64", "repository": "git@github.com:sbdchd/squawk.git", "license": "(Apache-2.0 OR MIT)", diff --git a/npm/darwin-x64/package.json b/npm/darwin-x64/package.json index 6d815655..f911bf1c 100644 --- a/npm/darwin-x64/package.json +++ b/npm/darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@squawk-cli/darwin-x64", - "version": "2.53.0", + "version": "2.54.0", "description": "squawk-cli binary for darwin-x64", "repository": "git@github.com:sbdchd/squawk.git", "license": "(Apache-2.0 OR MIT)", diff --git a/npm/linux-arm64/package.json b/npm/linux-arm64/package.json index 617b6629..6eac521f 100644 --- a/npm/linux-arm64/package.json +++ b/npm/linux-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@squawk-cli/linux-arm64", - "version": "2.53.0", + "version": "2.54.0", "description": "squawk-cli binary for linux-arm64", "repository": "git@github.com:sbdchd/squawk.git", "license": "(Apache-2.0 OR MIT)", diff --git a/npm/linux-x64/package.json b/npm/linux-x64/package.json index 4ca077b5..c9ffa8cd 100644 --- a/npm/linux-x64/package.json +++ b/npm/linux-x64/package.json @@ -1,6 +1,6 @@ { "name": "@squawk-cli/linux-x64", - "version": "2.53.0", + "version": "2.54.0", "description": "squawk-cli binary for linux-x64", "repository": "git@github.com:sbdchd/squawk.git", "license": "(Apache-2.0 OR MIT)", diff --git a/npm/win32-x64/package.json b/npm/win32-x64/package.json index 924b31c3..9acc4084 100644 --- a/npm/win32-x64/package.json +++ b/npm/win32-x64/package.json @@ -1,6 +1,6 @@ { "name": "@squawk-cli/win32-x64", - "version": "2.53.0", + "version": "2.54.0", "description": "squawk-cli binary for win32-x64", "repository": "git@github.com:sbdchd/squawk.git", "license": "(Apache-2.0 OR MIT)", diff --git a/package.json b/package.json index 5adaaa7c..9a6d7a43 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "squawk-cli", - "version": "2.53.0", + "version": "2.54.0", "description": "linter for PostgreSQL, focused on migrations", "repository": "git@github.com:sbdchd/squawk.git", "author": "Squawk Team & Contributors", diff --git a/squawk-vscode/package.json b/squawk-vscode/package.json index d527c8b2..7bfd26a2 100644 --- a/squawk-vscode/package.json +++ b/squawk-vscode/package.json @@ -12,7 +12,7 @@ "icon": "icon.png", "author": "Squawk Team & Contributors", "license": "(Apache-2.0 OR MIT)", - "version": "2.53.0", + "version": "2.54.0", "engines": { "vscode": "^1.101.0" },