File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
crates/pgt_workspace/src/workspace Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -570,8 +570,21 @@ impl Workspace for WorkspaceServer {
570
570
if let Some ( node) = stmt_root {
571
571
analysable_stmts. push ( node) ;
572
572
}
573
- // TODO: ignore the syntax error if we already have a diagnostic for it
574
573
if let Some ( diag) = diagnostic {
574
+ // ignore the syntax error if we already have more specialized diagnostics for the
575
+ // same statement.
576
+ // this is important for create function statements, where we might already have detailed
577
+ // diagnostics from plpgsql_check.
578
+ if diagnostics. iter ( ) . any ( |d| {
579
+ d. location ( ) . span . is_some_and ( |async_loc| {
580
+ diag. location ( )
581
+ . span
582
+ . is_some_and ( |syntax_loc| syntax_loc. contains ( async_loc) )
583
+ } )
584
+ } ) {
585
+ continue ;
586
+ }
587
+
575
588
diagnostics. push ( SDiagnostic :: new (
576
589
diag. with_file_path ( path. clone ( ) )
577
590
. with_severity ( Severity :: Error ) ,
You can’t perform that action at this time.
0 commit comments