Skip to content

Commit

Permalink
return diagnostics from parser errors (FuelLabs#4730)
Browse files Browse the repository at this point in the history
## Description

closes FuelLabs/sway-vscode-plugin#141
  • Loading branch information
JoshuaBatty authored Jul 4, 2023
1 parent 461f679 commit 5c36bd6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sway-lsp/src/core/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ impl Session {
} = res;

if value.is_none() {
// If there was an unrecoverable error in the parser
// make sure to still return the diagnostics.
*diagnostics = get_diagnostics(&warnings, &errors);
continue;
}
let Programs {
Expand Down

0 comments on commit 5c36bd6

Please sign in to comment.