supabase-community / postgres_lsp

A Language Server for Postgres
https://supabase.com
MIT License
3.32k stars 62 forks source link

feat: add support for create operator #77

Closed cvng closed 10 months ago

cvng commented 11 months ago

What kind of change does this PR introduce?

add support for create operator

What is the current behavior?

panics

What is the new behavior?

parser returns

View log ```rust DefineStmt { kind: ObjectOperator, oldstyle: false, defnames: [ Node { node: Some( String( String { sval: "+", }, ), ), }, ], args: [], definition: [ Node { node: Some( DefElem( DefElem { defnamespace: "", defname: "procedure", arg: Some( Node { node: Some( TypeName( TypeName { names: [ Node { node: Some( String( String { sval: "plusfunc", }, ), ), }, ], type_oid: 0, setof: false, pct_type: false, typmods: [], typemod: -1, array_bounds: [], location: 48, }, ), ), }, ), defaction: DefelemUnspec, location: 36, }, ), ), }, Node { node: Some( DefElem( DefElem { defnamespace: "", defname: "leftarg", arg: Some( Node { node: Some( TypeName( TypeName { names: [ Node { node: Some( String( String { sval: "int4", }, ), ), }, ], type_oid: 0, setof: false, pct_type: false, typmods: [], typemod: -1, array_bounds: [], location: 84, }, ), ), }, ), defaction: DefelemUnspec, location: 74, }, ), ), }, Node { node: Some( DefElem( DefElem { defnamespace: "", defname: "rightarg", arg: Some( Node { node: Some( TypeName( TypeName { names: [ Node { node: Some( String( String { sval: "int4", }, ), ), }, ], type_oid: 0, setof: false, pct_type: false, typmods: [], typemod: -1, array_bounds: [], location: 117, }, ), ), }, ), defaction: DefelemUnspec, location: 106, }, ), ), }, ], if_not_exists: false, replace: false, } ```

Additional context

waiting for the correct design in #72

cvng commented 10 months ago

@psteinroe now that #72 is merged this one is also ready for review