Releases: sbdchd/squawk
Spring Cleaning + Some IDE Improvements
Added
-
ide: goto def for select into (#1086)
select 1 a into t; -- ^ 2. dest select a from t; -- ^ 1. goto def src
and
select 1 a into t; -- ^ 2. dest select a from t; -- ^ 1. goto def src
-
ide: goto def with view & qualified column (#1081)
create view v as select 1 id, 2 b; -- ^ 2. dest select v.id from v; -- ^ 1. goto def src
-
ide: goto def from graph_table to create property graph (#1077)
create property graph myshop vertex tables (t key (a) no properties); -- ^ 2. dest select 1 from graph_table (myshop -- ^ 1. goto def src match (n is t) columns (1 as x));
-
fmt: more work towards full select and create table support (#1079)
-- before create table t(a int,b text); -- after create table t( a int, b text );
-- before select array[[1,2],[3,4]]; -- after select array[[1, 2], [3, 4]];
Fixed
-
ide: fix shadowing cte column w/
*hover + func call syntax for cte & views (#1094)-- shadowing create table t(a int, b int); with t as ( select 1 ), -- yy overrides y since there's only 1 column in the * u(x, yy) as ( select *, 2 y, 3 z from t ) select y from u; -- ^ 1. goto def src - doesn't resolve because of override above
-- function call syntax for cte column with cte as (select 1 as a) -- ^ 2. dest select a(cte) from cte; -- ^ 1. goto def src
-- function call syntax for view column create view v as select 1 as a; -- ^ 2. dest select a(v) from v; -- ^ 1. goto def src
Internal
- ide/server/wasm: use salsa for binder caching (#1078)
- ide: cleanup goto def & find ref tests to prep for extension support (#1080)
- ide: split resolve into resolve/collect/ast_nav & dedupe code (#1085)
- ide: consolidate name helpers (#1090)
- ide: update return types in resolve_name_ref to use Location (#1089)
- ide: simplify hovering for names (#1088)
- ide: refactor hover & find refs to use goto_def (#1087)
- ide: refactor resolve and fix a couple edge cases (#1094)
- ide: refactor resolve to use name related functions (#1092)
- ide: refactor code actions into their own modules (#1091)
New Rule: require-table-schema + IDE & Parser Improvements
Added
-
linter: add require-table-schema rule (#1046, #1064, #1073). Thanks @Flaiers!
Note: this rule is disabled by default and must be enabled via the new
--includeflag.-- error create table posts(id bigint); -- okay create table public.posts(id bigint);
-
parser: improve error recovery for misplaced join clauses (#1065)
The following now gives a concise error message:
-- join after the where select * from t where x > 1 join k on true;
-
parser: support more statement kinds in create schema parsing (#1061)
-
ide: semantic syntax highlighting improvements (#1059, #1060, #1068)
We now highlight all the tokens in types. We were missing some like
setof.Additionally, we highlight names by their underlying kind i.e., table, function, column.
This is powered by goto def.You can't tell from GitHub's highlighting, but if you use the language
server, we now highlight thebint.bas a function:create table t(a int); create function b(t) returns int as 'select 1' language sql; select b(t), t.b from t;
-
ide: show function comment on hover (#1070)
-
ide: code action to rewrite between != and <> (#1066)
-
ide: goto def for create property graph (#1074)
Fixed
-
parser: fix param parsing (#1068)
Before,
double precisionwas parsed as a param nameddoublewith typeprecision.
Now it's parsed correctly as an unnamed param of typedouble precision.create function f(double precision) returns int8 as 'select $1' language sql;
Semantic Syntax Highlighting
VSCode Syntax Highlighting Improvements
Parser Improvements & LSP server multi threading
new rule: require-enum-value-ordering & adding-not-nullable-field improvements
Added
- linter: add require-enum-value-ordering rule (#992). Thanks @cabello!
- linter: add cross-file validation for
NOT NULLconstraint pattern (#957). Thanks @reteps! - parser: support postgres 18 graph language (#1010)
- parser: support new except table clause (#986)
- parser: alter type ast improvements (#993)
- playground: add code folding support (#1000)
- ide: folding range support (#999)
- ide: goto def window defs & over clauses (#994)
- ide: goto def subquery compound selects (#988)
Fixed
- server: handle errors from handlers by converting to a lsp err response (#1005)
- parser: we weren't handling compound selects with extra parens (#989)
Changed
- server: pull based diagnostics (#1006)
Internal
- internal: replace lazy_static with std::sync::OnceLock (#1009)
- internal: HashMap -> FxHashMap, FxHashSet (#1007)
- server: refactor notification handling to embrace types (#1004)
- server: refactor request handling to embrace types (#1003)
- server: refactor lib.rs into separate files (#1002)
- ide: add thread module from rust-analyzer (#1001)
- parser: sync plpgsql test suite from postgres (#991)
- ide/playground: salsa most of the server functions (#981)
- ide: update sql stub codegen to include some extensions (#984)
Fix Squawk Ignore File Comment Bug + IDE Improvements
Added
- ide: quick action for
timestamp with out timezonetotimestamptz(#976) - ide: goto def for create aggregate params (#972)
- ide: hover/goto def for subquery w/ alias (#970)
- ide: lateral joins, subqueries with table, hover aliases (#969)
- ide: support table alias with column list (#968)
Fixed
- linter: fix ignore comment not working with trailing content (#975)
- ide: fix column name infer & related goto def (#977)
- syntax: update ast with missing
detach partitionfields (#978) - ide: fix builtin aggregates being defined as functions (#971)
- ci: fix arm musl build (#966)
Internal
- ide: refactor hover to use goto def (#967)
Revert changes to foreign key constraint & ide improvements
Changed
-
linter: undo foreign key constraint check in create table (#962)
This was an incorrect change to add and isn't necessary since the new table
doesn't have any rows.
Added
- ci: build for alpine arm (#960)
- ide: code action - rewrite between as binary expression (#953)
- ide: goto def & hover for now() + current_timestamp (#950)
- ide: goto def for column names in table function returns (#949)
- ide: goto def with function in from item & cross join (#961)
Fixed
- ide: fix col names for collation for, at time zone, overlaps (#951)
Improve `adding-foreign-key-constraint` & `adding-not-null-field`
Added
- linter: warn about foreign key constraints in create table defs (#945)
- parser: support on conflict do select & sync regression suite (#935)
- parser: improve create function table return type parsing (#944)
- ide: find ref support for builtins (#942)
- ide: support inherits/like tables in inlay hints (#936)
- ide: add quick fixes for leading
from(#933) - ide: goto def for builtins (#932)
Fixed
Changed
- linter: don't report lint errors when syntax error found (#943)
Fix TLS Issue with GitHub Commenting + More
Fixed
Added
-
parser: parse leading from clauses but warn they're not supported (#927)
from t select c;
now gives:
error[syntax-error]: Leading from clauses are not supported in Postgres ββΈ stdin:1:1 β 1 β from t select c; β°β΄ββββββWe also check for solo from clauses:
from t;gives:
error[syntax-error]: Missing select clause ββΈ stdin:1:1 β 1 β from t β°β΄β -
parser: fix parsing any/all/some in exprs (#926)
select * from t order by all
now properly errors:
error[syntax-error]: expected expression in atom_expr ββΈ stdin:1:26 β 1 β select * from t order by all β°β΄ β
Before it parsed
allas a name reference. -
ide: goto def func call in on conflict (#925)