File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ export const embedSql: NonNullable<Printer<Node>["embed"]> = (
2929 return null ;
3030 }
3131
32- if ( isRoutine ( parent , grandParent ) ) {
32+ if ( isAsClause ( parent ) && isRoutine ( grandParent ) ) {
3333 if ( grandParent . clauses . some ( isSqlLanguageClause ) ) {
3434 return sqlFormatter ( node , pluginOptions ) ;
3535 }
@@ -96,9 +96,10 @@ const plpgsqlFormatter = (
9696 } ;
9797} ;
9898
99- const isRoutine = ( parent : any , grandParent : any ) : boolean =>
100- isAsClause ( parent ) &&
101- ( isCreateFunctionStmt ( grandParent ) || isCreateProcedureStmt ( grandParent ) ) ;
99+ const isRoutine = (
100+ node : any ,
101+ ) : node is CreateFunctionStmt | CreateProcedureStmt =>
102+ isCreateFunctionStmt ( node ) || isCreateProcedureStmt ( node ) ;
102103
103104const isSqlLanguageClause = (
104105 clause : CreateFunctionStmt [ "clauses" ] [ 0 ] | CreateProcedureStmt [ "clauses" ] [ 0 ] ,
You can’t perform that action at this time.
0 commit comments