Skip to content

Releases: sbdchd/squawk

Spring Cleaning + Some IDE Improvements

27 Apr 04:27
72f24fc

Choose a tag to compare

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

18 Apr 16:28
38ee75b

Choose a tag to compare

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
    --include flag.

    -- 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 the b in t.b as 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 precision was parsed as a param named double with type precision.
    Now it's parsed correctly as an unnamed param of type double precision.

    create function f(double precision) returns int8
      as 'select $1'
      language sql;

Semantic Syntax Highlighting

13 Apr 23:30
8d72121

Choose a tag to compare

Added

  • ide: semantic syntax highlighting (#1057, #1058, #1052)

  • ide: semantic syntax highlighting (#1048)

  • playground: update syntax highlighting language with codegen'd keywords (#1055, #1054)

  • vscode: update syntax highlighting to support more operators (#1047)

  • ide: goto def for user, current_user, session_user, & current_schema (#1056)

VSCode Syntax Highlighting Improvements

06 Apr 03:39
9d37508

Choose a tag to compare

Added

  • ide: goto def support for dec & float(n) types (#1042)
  • vscode: vendor and improve postgres syntax highlighting grammar (#1043, #1041, #1039)
  • parser: sync pg regressions suite & support the new ForPortionOf clause (#1038)

Fixed

  • ide: fix column naming for dec & float(n) (#1040)

Parser Improvements & LSP server multi threading

02 Apr 02:52
6cfd902

Choose a tag to compare

Added

Internal

  • internal: bump rust to 1.94 (#1015)

new rule: require-enum-value-ordering & adding-not-nullable-field improvements

20 Mar 01:09
3c95f5c

Choose a tag to compare

Added

  • linter: add require-enum-value-ordering rule (#992). Thanks @cabello!
  • linter: add cross-file validation for NOT NULL constraint 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

28 Feb 21:11
c1f6c7c

Choose a tag to compare

Added

  • ide: quick action for timestamp with out timezone to timestamptz (#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 partition fields (#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

26 Feb 03:36
ca4a8b3

Choose a tag to compare

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`

21 Feb 04:51
6bcf98e

Choose a tag to compare

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

  • linter: fix adding-not-nullable-field for pg >= 12 with validated CHECK (#910). Thanks @reteps!

Changed

  • linter: don't report lint errors when syntax error found (#943)

Fix TLS Issue with GitHub Commenting + More

12 Feb 23:27
f42cbd9

Choose a tag to compare

Fixed

  • github: fix commenting via rust_crypto features in jsonwebtoken (#929). Thanks @lokiwins!

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 all as a name reference.

  • ide: goto def func call in on conflict (#925)