Skip to content

Commit

Permalink
add timeout to formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewNolte committed Oct 11, 2024
1 parent e108af1 commit e5cc36c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/FormatProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,14 @@ class VeribleVerilogFormatEditProvider
input: document.getText(),
cwd: getWorkspaceFolder(),
encoding: 'utf-8',
timeout: 2000,
})
if (result.stdout.length === 0) {
vscode.window.showErrorMessage('Verilog formatting failed: empty output')
return []
}
if (result.status === null) {
vscode.window.showErrorMessage('Verilog formatting failed: timed out')
return []
}
return [
Expand Down

0 comments on commit e5cc36c

Please sign in to comment.